new testprogram: factorial
This commit is contained in:
parent
c536e969d6
commit
368e1be5c6
1 changed files with 2 additions and 3 deletions
5
test.pl
5
test.pl
|
@ -4,10 +4,9 @@ use Minilisp;
|
|||
use Data::Dumper;
|
||||
|
||||
my $term = <<EOF;
|
||||
(progn
|
||||
(defun avg-2 (a b) (/ (+ a b) 2))
|
||||
(defun fact (n) (if (> n 1) (* n (fact (- n 1))) 1))
|
||||
|
||||
(write-line (avg-2 1 19)))
|
||||
(write-line (fact 5))
|
||||
EOF
|
||||
|
||||
my $parsed = Minilisp::compile($term);
|
||||
|
|
Loading…
Reference in a new issue