22 lines
261 B
Perl
22 lines
261 B
Perl
|
use lib "./lib";
|
||
|
|
||
|
use Minilisp;
|
||
|
use Data::Dumper;
|
||
|
|
||
|
my $term = <<EOF;
|
||
|
(progn
|
||
|
(print "Hello")
|
||
|
(print "World")
|
||
|
(print a)
|
||
|
1)
|
||
|
EOF
|
||
|
|
||
|
my $parsed = Minilisp::compile($term);
|
||
|
|
||
|
my $ctx = {
|
||
|
'a' => "bar",
|
||
|
};
|
||
|
|
||
|
print "$term\n";
|
||
|
print ":= " . $parsed->($ctx) . "\n";
|