The following behavior of `let' seems to be wrong.

guile> (version)
"1.8.8"
guile> 
(let ((go #f)
      (alist '()))
  (let ((a 1) (b (call-with-current-continuation (lambda (x) (set! go x) 2))))
    (set! alist (cons (cons a b) alist))
    (set! a 100)
    (set! alist (cons (cons a b) alist))
    (if (< (length alist) 3)
        (go 2)
        (reverse alist))))
((1 . 2) (100 . 2) (100 . 2) (100 . 2))
guile>;; inconsistency between let and lambda
(let ((go #f)
      (alist '()))
  ((lambda (a b)
     (set! alist (cons (cons a b) alist))
     (set! a 100)
     (set! alist (cons (cons a b) alist))
     (if (< (length alist) 3)
         (go 2)
         (reverse alist)))
   1 (call-with-current-continuation (lambda (x) (set! go x) 2))))
((1 . 2) (100 . 2) (1 . 2) (100 . 2))
guile>

-- 
Joo ChurlSoo


Reply via email to