正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 2.2.10 and i feel like i should be shouting this out! l The semantics says that the value of a lambda expression is a procedure object. It is some internal representation of the THE VALUE OF procedure that includes information about the formal A LAMBDA EXPRESSION parameters and the body, or pattern of computation s A PROCEDURE tonne 6 001 SICP 6.001 Notes: Section 2.3 Slide 2.3.1 We have now seen most of the basic elements of scheme. We Using procedures to describe processes will continue to add a few more special forms, and introduce low can we use the idea of a procedure to capture a some additional built in procedures, but we now have enough elements of the language to start reasoning about processes, and especially to use procedures to describe computational processes So let's look at some examples of describing processes in procedures What does a procedure describe? Slide 2.3.2 First, what does a procedure describe? (33) One useful way of thinking about this is as a means of (2525) generalizing a common pattern of operations. For example foobar foobar) consider the three expressions shown here. The first two are straightforward. The third is a bit more general, since foobar is presumably a name for some numerical value However, each of these is basically just a specific instantiation of a process: the process of multiplying a value by itself, or the 6 001 SICP6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 2.2.10 ... and I feel like I should be shouting this out!! The semantics says that the value of a lambda expression is a procedure object. It is some internal representation of the procedure that includes information about the formal parameters and the body, or pattern of computation. 6.001 Notes: Section 2.3 Slide 2.3.1 We have now seen most of the basic elements of Scheme. We will continue to add a few more special forms, and introduce some additional built in procedures, but we now have enough elements of the language to start reasoning about processes, and especially to use procedures to describe computational processes. So let's look at some examples of describing processes in procedures. Slide 2.3.2 First, what does a procedure describe? One useful way of thinking about this is as a means of generalizing a common pattern of operations. For example, consider the three expressions shown here. The first two are straightforward. The third is a bit more general, since foobar is presumably a name for some numerical value. However, each of these is basically just a specific instantiation of a process: the process of multiplying a value by itself, or the process of "squaring
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有