1 ! Copyright (C) 2008 James Cash
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: lisp lisp.parser tools.test sequences math kernel parser arrays lists
16 "(- 10.4 2.1)" lisp-eval
20 "((lambda (x y) (+ x y)) 1 2)" lisp-eval
24 "((lambda (x y z) (+ x (- y z))) 40 3 1)" lisp-eval
28 "(cond (#f \"a\") (#t \"b\"))" lisp-eval
32 "(cond ((< 1 2) \"b\") (#t \"a\"))" lisp-eval
40 "(list 1 2 3 4 5)" lisp-eval list>seq
43 { { 1 2 { 3 { 4 } 5 } } } [
44 "(list 1 2 (list 3 (list 4) 5))" lisp-eval cons>seq
48 "(begin (+ 1 4))" lisp-eval
52 "(begin (+ 5 6) (+ 1 4))" lisp-eval
56 T{ lisp-symbol f "if" } lisp-macro?
60 "(if #t 1 2)" lisp-eval
64 "((lambda (x) (if x (+ 1 2) (- 3 5))) #t)" lisp-eval
68 "((lambda (x &rest xs) (cons x xs)) 5 4 3)" lisp-eval cons>seq
72 "((lambda (x &rest xs) (cons x xs)) 5)" lisp-eval cons>seq
76 "((lambda (&rest xs) xs) 1 2 3 4)" lisp-eval cons>seq
80 <LISP (begin (+ 1 2) (+ 9 1)) LISP>
84 <LISP ((lambda (x y) (if x (+ 1 y) (+ 2 y))) #t 3) LISP>
88 <LISP (defun foo (x y &rest z)
94 ] with-interactive-vocabs