From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@chbouib.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: slowness in guile 1.8 Date: Sat, 26 May 2007 15:15:34 +0200 Message-ID: <87sl9jn2tl.fsf@chbouib.org> References: <1180110804.4388.16.camel@localhost.localdomain> <87tzu0pybk.fsf@chbouib.org> <1180176594.4388.29.camel@localhost.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1180185366 20741 80.91.229.12 (26 May 2007 13:16:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 26 May 2007 13:16:06 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat May 26 15:16:05 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hrw7p-0003Zc-Ax for guile-devel@m.gmane.org; Sat, 26 May 2007 15:16:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hrw7o-0002c1-TF for guile-devel@m.gmane.org; Sat, 26 May 2007 09:16:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hrw7k-0002YG-FR for guile-devel@gnu.org; Sat, 26 May 2007 09:16:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hrw7j-0002XM-4U for guile-devel@gnu.org; Sat, 26 May 2007 09:15:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hrw7i-0002XJ-W1 for guile-devel@gnu.org; Sat, 26 May 2007 09:15:59 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hrw7i-0004Up-9a for guile-devel@gnu.org; Sat, 26 May 2007 09:15:58 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Hrw7d-0002DC-AH for guile-devel@gnu.org; Sat, 26 May 2007 15:15:53 +0200 Original-Received: from adh419.fdn.fr ([80.67.176.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 May 2007 15:15:53 +0200 Original-Received: from ludo by adh419.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 May 2007 15:15:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: adh419.fdn.fr X-URL: http://www.laas.fr/~lcourtes/ X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i486-pc-linux-gnu User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:72ozd7sdyQnMN2xKtcFLFGUrZ8A= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6619 Archived-At: Hi Andy! Andy Wingo 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 is not bound, however, then the definition will > bind 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