From: ludo@chbouib.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: slowness in guile 1.8
Date: Sat, 26 May 2007 15:15:34 +0200 [thread overview]
Message-ID: <87sl9jn2tl.fsf@chbouib.org> (raw)
In-Reply-To: 1180176594.4388.29.camel@localhost.localdomain
Hi Andy!
Andy Wingo <wingo@pobox.com> writes:
> On Fri, 2007-05-25 at 20:12 +0200, Ludovic Courtès wrote:
>> Alas, it breaks the following test in `syntax.test':
>
> I'm not sure what "it" is in this case; I assume you mean the fix to
> module-make-local-var!.
"It" means "the reordering of `eval_car' and `sym2var' in `eval.c'".
>> (pass-if "binding is created before expression is evaluated"
>> (= (eval '(begin
>> (define foo
>> (begin
>> (set! foo 1)
>> (+ foo 1)))
>> foo)
>> (interaction-environment))
>> 2))
>>
>> This test case illustrates the fact that _internal_ defines are
>> equivalent to `letrec' (Section 5.2.2); top-level defines should behave
>> similarly for new variables (Section 5.2.1).
>
> I don't know what you are trying to say here; top-level defines do not
> "behave similarly" to letrec. R5RS says in section 5.2.1:
>
> If <variable> is not bound, however, then the definition will
> bind <variable> to a new location before performing the
> assignment, whereas it would be an error to perform a `set!' on
> an unbound variable.
>
> The new variable should be created before the assignment, but _not
> necessarily before evaluation of the rhs_.
Oh, right, there's a subtle difference here, so your interpretation may
well be valid, indeed.
> I think the test is bogus.
Actually, no: the test does a `define' _within_ the body of `begin', so
I *think* this qualifies as an internal define, and internal defines are
equivalent to `letrec' (Section 5.2.2). So the test is equivalent to:
(letrec ((foo (begin
(set! foo 1)
(+ foo 1))))
foo)
And this is valid (and does actually work in all the previously
mentioned implementations except SCM).
IOW, `scm_m_define ()' must be refined to distinguish between internal
defines and top-level defines.
Needs some more thought now...
Thanks!
Ludovic.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2007-05-26 13:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 16:33 slowness in guile 1.8 Andy Wingo
2007-05-25 18:12 ` Ludovic Courtès
2007-05-26 10:49 ` Andy Wingo
2007-05-26 10:57 ` Andy Wingo
2007-05-26 13:15 ` Ludovic Courtès [this message]
2007-05-26 14:45 ` Ludovic Courtès
2007-05-26 15:39 ` Andy Wingo
2007-06-13 22:24 ` Ludovic Courtès
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=87sl9jn2tl.fsf@chbouib.org \
--to=ludo@chbouib.org \
--cc=guile-devel@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).