[Prev][Next][Index][Thread]

Re: small Q



In article <r8titt9tapp.fsf@chinstrap.CS.Princeton.EDU>, "Daniel C. 
Wang" <danwang+news@cs.princeton.edu> wrote:

> (define zero (lambda (z s) z))
> (define succ (lambda (n) 
>                  (lambda (z s) (s (n z s)))))
> (define one   (succ zero))
> 
> (define nat_case (lambda (n z s) (n z s)))
> (define if0 (lambda (n t f) ((nat_case n t 
>                                          (lambda (x) f))))) 

This is good stuff, but aren't you assuming a few too many features for 
a "lambda-only" thing?

((lambda (zero)
  ((lambda (succ)
    ((lambda (one)
      
       ...


     ) (succ zero))
   ) (lambda (n) (lambda (z) (lambda (s) (s ((n z) s))))))
 ) (lambda (z) (lambda (s) z)))

Or something like that :-)

-- Bruce



References: