Add support for the difference / negation operator.
[berndj-bootstrap.git] / lisp / test-expected
blob2d2f1f4ce1ff8b96d263724cb0648c50de9ebb03
1 (+ 4 5) -> 9
2 (- 23 7) -> 16
3 (cons 17 42) -> (17 . 42)
4 (car (cons 17 42)) -> 17
5 #t -> #t
6 cons -> builtin-function
7 lambda -> builtin-macro
8 (lambda () 42) -> user-function
9 ((lambda () 42)) -> 42
10 ((lambda (a) (+ 2 a)) 17) -> 19
11 (quote ()) -> ()
12 (quote (a b c)) -> (a b c)
13 (if #t 17 42) -> 17
14 (if #f 17 42) -> 42
15 (if #f 17) -> ()
16 (eq? (quote ()) (quote ())) -> #t
17 (eq? 12 12) -> #t
18 (eq? 12 24) -> #f
19 (eq? (cons 2 3) (cons 2 3)) -> #f
20 (eq? (quote foo) (quote foo)) -> #t
21 (eq? (quote foo) (quote bar)) -> #f
22 (eq? "foo" "foo") -> #f
23 (eq? "foo" (quote foo)) -> #f
24 (list? 17) -> #f
25 (list? (cons 17 42)) -> #f
26 (list? (cons 17 (quote ()))) -> #t
27 (primitive-eval (quote (+ 17 42))) -> 59
28 (define (foo a b) (+ a b)) -> ()
29 (foo 17 42) -> 59
30 (cdr (quote (17 . 42))) -> 42
31 (quote (17 12 14)) -> (17 12 14)
32 (define (foo x) (if (eq? x 5) 1 (+ (foo (+ x 1)) (foo (+ x 1))))) -> ()
33 (foo 2) -> 8
34 ((lambda rest (cdr rest)) 1 2 3 4) -> (2 3 4)
35 (define (mylist . rest) rest) -> ()
36 (mylist 1 2 3 4) -> (1 2 3 4)
37 (define (mymap f l) (if (eq? l (quote ())) (quote ()) (cons (f (car l)) (mymap f (cdr l))))) -> ()
38 (mymap (lambda (x) (+ x 1)) (quote (1 2 4 8))) -> (2 3 5 9)
39 (string->list "hello") -> (104 101 108 108 111)