unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Joo ChurlSoo <initerm@gmail.com>
To: guile-user@gnu.org
Subject: inconsistency between let and lambda
Date: Fri, 14 Jan 2011 01:58:50 +0900	[thread overview]
Message-ID: <87zkr4n3jp.fsf@gmail.com> (raw)


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	other threads:[~2011-01-13 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 16:58 Joo ChurlSoo [this message]
2011-01-15 20:42 ` inconsistency between let and lambda Neil Jerram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zkr4n3jp.fsf@gmail.com \
    --to=initerm@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).