例1
(define ex1
(lambda ()
(let* ((x 1) (y x) (z y))
(display (list x y z)))))
Racket: (1 1 1)
tinyscheme: (1 1 1)#t
Gauche: (1 1 1)#
例2
(define ex2
(lambda ()
(define x 1)
(define y x)
(define z y)
(display (list x y z))))
Racket: (1 #
tinyscheme: (1 1 1)#t
Gauche: (1 1 1)#
例3
(define ex3
(lambda ()
(letrec
(
(x '(() ()))
)
(set-car! x (cons 1 (car x)))
x
)))
Racket:
>(ex3)
((1) ())
>(ex3)
((1 1) ())
tinyscheme:
>(ex3)
((1) ())
>(ex3)
((1 1) ())
Gauche:
>(ex3)
((1) ())
>(ex3)
((1) ())
0 件のコメント:
コメントを投稿