new testprogram: factorial

This commit is contained in:
madmaurice 2021-04-02 02:46:43 +02:00
parent c536e969d6
commit 368e1be5c6

View file

@ -4,10 +4,9 @@ use Minilisp;
use Data::Dumper; use Data::Dumper;
my $term = <<EOF; my $term = <<EOF;
(progn (defun fact (n) (if (> n 1) (* n (fact (- n 1))) 1))
(defun avg-2 (a b) (/ (+ a b) 2))
(write-line (avg-2 1 19))) (write-line (fact 5))
EOF EOF
my $parsed = Minilisp::compile($term); my $parsed = Minilisp::compile($term);