September 22, 1999 | Perl and the Lambda Calculus | Slide #34 |
Why write a parser and an interpreter?
We already have one.
In Perl:
x.E => sub { my $x = shift; E }
(E F) => $E->($F)
For example:
# TRUE = pq.p $TRUE = sub { my $p = shift; sub { my $q = shift; $p }; };
We can use this to try out the abstract stuff from the previous slides
Next | Copyright © 1999 M-J. Dominus |