From: Neil Jerram <neil@ossau.uklinux.net>
To: Joo ChurlSoo <initerm@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: inconsistency between let and lambda
Date: Sat, 15 Jan 2011 20:42:25 +0000 [thread overview]
Message-ID: <87hbd9gaq6.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87zkr4n3jp.fsf@gmail.com> (Joo ChurlSoo's message of "Fri, 14 Jan 2011 01:58:50 +0900")
Joo ChurlSoo <initerm@gmail.com> writes:
> 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>
For what it's worth, my current Guile, from Git post 1.9.14, gives ((1
. 2) (100 . 2) (1 . 2) (100 . 2)) for both cases.
Neil
prev parent reply other threads:[~2011-01-15 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 16:58 inconsistency between let and lambda Joo ChurlSoo
2011-01-15 20:42 ` Neil Jerram [this message]
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=87hbd9gaq6.fsf@ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=guile-user@gnu.org \
--cc=initerm@gmail.com \
/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).