The encoding of boolean expressions is described on (book) page 16.
Regards,
Ricardo
Am 17.02.2020 18:12 schrieb Lawrence Bottorff:
> I found these blowing down the sidewalk today
>
> ; TRUE = λx.λy.x
> (define mytrue
> (lambda (t) (lambda (f) t)))
>
> and
>
> ; FALSE = λx.λy.y
> (define myfalse
> (lambda (t) (lambda (f) f)))
>
> Two problems, I don't understand them and AFAICT, they don't work. I
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lawrence Bottorff, racket users
In addition to Ricardo's good answer:
The definition of TRUE above is one of the combinators of the S-K-I
combinator calculus, which is a simple to understand subset of the
untyped lambda calculus. Programs in S-K-I are expressed as
sequences of 3 simple combinators, and computation is done by
repeated expansion, application and reduction until an irreducible
form - the result - is reached.
It introduces church numeral encodings and also this kind of true-false encoding as small programming challenges in Racket. It assumes that you already know how to program in Racket. It doesn’t go deep.
John
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.