X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=_rosetta1.mdwn;h=e02b1c18878d26b990a923423d5278a933355c4c;hp=2e6049ca5ba66235a2a46b33f35c16252260df73;hb=1f812aceae40b0f6f80a04acc90b2e5194b50591;hpb=8d7045981a2a3c5f12fecd1608598bfdd9d678a4 diff --git a/_rosetta1.mdwn b/_rosetta1.mdwn index 2e6049ca..e02b1c18 100644 --- a/_rosetta1.mdwn +++ b/_rosetta1.mdwn @@ -36,7 +36,7 @@ The following site may be useful; it lets you run a Scheme interpreter inside yo ((foo 2) 3) - These functions are "curried". `foo 2` returns a `2`-fooer, which waits for an argument like `3` and then foos `2` to it. `( + ) 2` returns a `2`-adder, which waits for an argument like `3` and then adds `2` to it. For further reading: + These functions are "curried". `foo 2` returns a `2`-fooer, which waits for an argument like `3` and then foos `2` to it. `( + ) 2` returns a `2`-adder, which waits for an argument like `3` and then adds `2` to it. For further reading: * [[!wikipedia Currying]] @@ -71,7 +71,7 @@ The following site may be useful; it lets you run a Scheme interpreter inside yo But supposing you had constructed appropriate values for `+` and `3` and `2`, you'd place them in the ellided positions in: (((\three (\two ((... three) two))) ...) ...) - + In an ordinary imperatival language like C: int three = 3; @@ -179,7 +179,7 @@ The following site may be useful; it lets you run a Scheme interpreter inside yo (let* [(three (+ 1 2))] (let* [(two 2)] (+ three two))) - + It was also asked whether the `(+ 1 2)` computation would be performed before or after it was bound to the variable `three`. That's a terrific question. Let's say this: both strategies could be reasonable designs for a language. We are going to discuss this carefully in coming weeks. In fact Scheme and OCaml make the same design choice. But you should think of the underlying form of the `let`-statement as not settling this by itself. Repeating our starting point for reference: @@ -335,7 +335,7 @@ The following site may be useful; it lets you run a Scheme interpreter inside yo int x = 3; x = 2; - + but it's not the same! In the latter case we have mutation, in the former case we don't. You will learn to recognize the difference as we proceed. The OCaml expression just means: