正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology 6.001 Notes: Section 2.1 Slide 2.l.1 In the last lecture, we began looking at the programming This lecture nguage Scheme. with the intent of learning how that anguage would provide a basis for describing procedures and Adding procedures and procedural abstractions processes, and thus for understanding computational metaphors Using procedures to capture processes for controlling complex processes. In this lecture, we look at how to create procedural abstractions in our language, and how to use those abstractions to describe and capture computational Language elements -abstractions Well--we' ve got primitives (numbers and built in procedures) weve got means of combination(ways of creating comple expressions); and we've got our first means of abstraction(a way of giving a name to something ). But we are still stuck just writing out arithmetic expressions, as the only procedures we have are the built in ones We need a need another kind of abstraction--we need a way of capturing particular processes n our own procedures, and that's what we turn to next 1m003 6 001 SICP Slide 2.1.3 In Scheme, we have a particular expression for capturing a procedure It's called a lambda expression. It has the form Language elements--abstractions shown, an open parenthesis, the keyword lambda, followed by Need to capture ways of doing things-use some number of symbols enclosed within parentheses, followed by one or more legal expressions, followed by a close (lambda(x)(xx))6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. 6.001 Notes: Section 2.1 Slide 2.1.1 In the last lecture, we began looking at the programming language, Scheme, with the intent of learning how that language would provide a basis for describing procedures and processes, and thus for understanding computational metaphors for controlling complex processes. In this lecture, we look at how to create procedural abstractions in our language, and how to use those abstractions to describe and capture computational processes. Slide 2.1.2 Well -- we've got primitives (numbers and built in procedures); we've got means of combination (ways of creating complex expressions); and we've got our first means of abstraction (a way of giving a name to something). But we are still stuck just writing out arithmetic expressions, as the only procedures we have are the built in ones. We need a way to capture our own processes in our own procedures. So we need another kind of abstraction -- we need a way of capturing particular processes in our own procedures, and that's what we turn to next. Slide 2.1.3 In Scheme, we have a particular expression for capturing a procedure. It's called a lambda expression. It has the form shown, an open parenthesis, the keyword lambda, followed by some number of symbols enclosed within parentheses, followed by one or more legal expressions, followed by a close parenthesis
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有