tweaked week3
authorJim Pryor <profjim@jimpryor.net>
Sat, 18 Sep 2010 21:42:26 +0000 (17:42 -0400)
committerJim Pryor <profjim@jimpryor.net>
Sat, 18 Sep 2010 21:42:26 +0000 (17:42 -0400)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
week3.mdwn

index f5f075a..29a058c 100644 (file)
@@ -24,7 +24,7 @@ Some comments on this:
 
 2. `cdr` is function that gets the tail of a Scheme list. (By definition, it's the function for getting the second member of an ordered pair. It just turns out to return the tail of a list because of the particular way Scheme implements lists.)
 
-What is the `let rec` in the OCaml code and the `letrec` in the Scheme code? These work like the `let` expressions we've already seen, except that they let you use the variable `get_length` *inside* the body of the function being bound to it---with the understanding that it will there refer to the same function that you're then in the process of binding to `get_length`. In OCaml:
+What is the `let rec` in the OCaml code and the `letrec` in the Scheme code? These work like the `let` expressions we've already seen, except that they let you use the variable `get_length` *inside* the body of the function being bound to it---with the understanding that it will there refer to the same function that you're then in the process of binding to `get_length`. So our recursively-defined function works the way we'd expect it to. In OCaml:
 
        let rec get_length = fun lst ->
                if lst == [] then 0 else 1 + get_length (tail lst)