Gambit Version 3.0 > 1 1 > #t #t > #f #f > 'x x > 'allo allo > '#f #f > #\d #\d > #\newline #\newline > #\space #\space > '#(1 2 3 4 5) #(1 2 3 4 5) > '#(#t rummy #\newline #(12)) #(#t rummy #\newline #(12)) > '(1 . 2) (1 . 2) > '(1 2 3) (1 2 3) > '(1 . (2 . (3 . ()))) (1 2 3) > (1 2 3) *** ERROR -- Operator is not a PROCEDURE (1 2 3) 1> > 1 1 > 1/4 1/4 > 2/8 1/4 > 2.34 2.34 > 3+i 3+i > "allo" "allo" > 'allo allo > (lambda (x) x) # > (char? #\newline) #t > (char? '#(1 2 3)) #f > (let ((x (+ 3 4))) x) 7 > '(1 2 3) (1 2 3) > (quote (1 2 3)) (1 2 3) > ((lambda (a b) (- a (/ 1 b))) 3 4) 11/4 > (lambda (x y z . rest) (list x y z rest)) # > ((lambda (x y z . rest) (list x y z rest)) 1 2 3 4 5 6 7) (1 2 3 (4 5 6 7)) > ((lambda rest (list rest)) 1 2 3 4 5 6 7) ((1 2 3 4 5 6 7)) > (if (= 3 4) 'toto 'foo) foo > (if (= 3 4) (begin (display "1") 'toto) (begin (display "2") 'foo)) 2foo > (if (= 3 4) (begin (display "1") 'toto)) > (define glob 8) > (set! glob 9) > glob 9 > (cond ((= glob 8) (display "8")) ((= glob 9) (display "9")) (else (display "autre"))) 9> 1 1 > 1 1 > 1 1 > (case glob ((1 2 3 4) 'premier) ((5 6 7 8 9) 'second) (else 'troisieme)) second > (and (> glob 0) (/ 1 glob)) 1/9 > (set! glob 0) > (and (> glob 0) (/ 1 glob)) #f > (let ((x 5) (y (* glob 8)) (z (- 8 4))) (list x y z)) (5 0 4) > (let ((glob (list glob))) glob) (0) > (let* ((x 5) (y (* x 5)) (z (- x y))) (list x y z)) (5 25 -20) > (let ((fact (lambda (n) (if (<= n 0) 1 (* n (fact (- n 1))))))) (fact 4)) *** ERROR IN #, (stdin)@55.13 -- Unbound variable: fact 1> > (letrec ((fact (lambda (n) (if (<= n 0) 1 (* n (fact (- n 1))))))) (fact 4)) 24 > (letrec ((even? (lambda (n) (if (= n 0) #t (odd? (- n 1))))) (odd? (lambda (n) (if (= n 0) #f (even? (- n 1)))))) (even? 8)) #t > (begin (display "allo") (newline) 'result) allo result > (let fact ((n 4)) (if (<= n 0) 1 (* n (fact (- n 1))))) 24 > (define s "string") > s "string" > (define s "allo") > s "allo" > (set! s "hello") > s "hello" > (= glob 0) #t > (= "str" "str") *** ERROR IN (stdin)@83.1 -- NUMBER expected (= "str" "str") 1> > (equal? '(1 2 3) (list 1 2 3)) #t > (eq? '(1 2 3) (list 1 2 3)) #f > (equal? "str" "str") #t > (eq? "str" "str") #f > (eq? 1 1) #t > (eq? 1.0 1.0) #f > (eq? 'symbol 'symbol) #t > (eq? (string->symbol "test") (string->symbol "test")) #t