Implement (list->string LIST). Not quite the same as in guile.
[berndj-bootstrap.git] / lisp / test-expected
blobd976cff62b5d3569b94d2b7e6a5e054690c1fad2
1 (+ 4 5) -> 9
2 (+ 1 2 3 4 5) -> 15
3 (- 23 7) -> 16
4 (- 15 5 4 3) -> 3
5 (- 17) -> -17
6 (cons 17 42) -> (17 . 42)
7 (car (cons 17 42)) -> 17
8 #t -> #t
9 cons -> builtin-function
10 lambda -> builtin-macro
11 (lambda () 42) -> user-function
12 ((lambda () 42)) -> 42
13 ((lambda (a) (+ 2 a)) 17) -> 19
14 (quote ()) -> ()
15 (quote (a b c)) -> (a b c)
16 (if #t 17 42) -> 17
17 (if #f 17 42) -> 42
18 (if #f 17) -> ()
19 (eq? (quote ()) (quote ())) -> #t
20 (eq? 12 12) -> #t
21 (eq? 12 24) -> #f
22 (eq? (cons 2 3) (cons 2 3)) -> #f
23 (eq? (quote foo) (quote foo)) -> #t
24 (eq? (quote foo) (quote bar)) -> #f
25 (eq? "foo" "foo") -> #f
26 (eq? "foo" (quote foo)) -> #f
27 (list? 17) -> #f
28 (list? (cons 17 42)) -> #f
29 (list? (cons 17 (quote ()))) -> #t
30 (primitive-eval (quote (+ 17 42))) -> 59
31 (define (foo a b) (+ a b)) -> ()
32 (foo 17 42) -> 59
33 (cdr (quote (17 . 42))) -> 42
34 (quote (17 12 14)) -> (17 12 14)
35 (define (foo x) (if (eq? x 5) 1 (+ (foo (+ x 1)) (foo (+ x 1))))) -> ()
36 (foo 2) -> 8
37 ((lambda rest (cdr rest)) 1 2 3 4) -> (2 3 4)
38 (define (mylist . rest) rest) -> ()
39 (mylist 1 2 3 4) -> (1 2 3 4)
40 (define (mymap f l) (if (eq? l (quote ())) (quote ()) (cons (f (car l)) (mymap f (cdr l))))) -> ()
41 (mymap (lambda (x) (+ x 1)) (quote (1 2 4 8))) -> (2 3 5 9)
42 (string->list "hello") -> (104 101 108 108 111)
43 (list->string (quote (104 101 108 108 111))) -> "hello"
44 (list->string (string->list "world")) -> "world"
45 (define (foo z) (+ x z)) -> ()
46 ((lambda (x) (foo 13)) 1) -> 13