From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: Eval, tail calls, (current-module), and backward compatibility Date: Tue, 17 Jan 2012 12:02:37 +0100 Organization: Organization?!? Message-ID: <878vl6twvm.fsf@fencepost.gnu.org> References: <87lip70zz7.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326798190 4401 80.91.229.12 (17 Jan 2012 11:03:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Jan 2012 11:03:10 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 17 12:03:06 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rn6oi-00037t-0C for guile-devel@m.gmane.org; Tue, 17 Jan 2012 12:03:04 +0100 Original-Received: from localhost ([::1]:38641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn6oh-0000h1-HX for guile-devel@m.gmane.org; Tue, 17 Jan 2012 06:03:03 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn6oa-0000cg-8Y for guile-devel@gnu.org; Tue, 17 Jan 2012 06:03:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn6oW-0008Qx-1d for guile-devel@gnu.org; Tue, 17 Jan 2012 06:02:56 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:44260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn6oV-0008Qr-RR for guile-devel@gnu.org; Tue, 17 Jan 2012 06:02:52 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rn6oU-0002zo-UA for guile-devel@gnu.org; Tue, 17 Jan 2012 12:02:50 +0100 Original-Received: from p508ea1c5.dip.t-dialin.net ([80.142.161.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Jan 2012 12:02:50 +0100 Original-Received: from dak by p508ea1c5.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Jan 2012 12:02:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ea1c5.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:SwyYM/rJPRAk9AIx3tBJ+aInxYU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13554 Archived-At: Mark H Weaver writes: > (current-module) should be relevant only at the beginning of > macro-expansion: before any program transformations are performed, > (current-module) is "baked" into every symbol of the top-level form. > (psyntax actually does this lazily, but the effect is the same). > > After that, (current-module) should be completely irrelevant to the rest > of compilation and evaluation. It isn't if you call it in the code. Personally, I am not sure that it should reflect the second argument of eval if that is different from the current module in which eval has been called. Does R5RS have an opinion on modules and eval? > Ideally, I think that `eval' should set (current-module) during > expansion, but _not_ during evaluation. Then it can be properly tail > recursive. However, some code out there might depend on the existing > behavior, so I guess we can't change this, at least not in 2.0. > Bummer. I am not sure. If you rebind current-module itself during expansion, you might be able to retain the currently visible behavior while being in tail-call position during execution. Of course, if any user meddles with the value of current-module other than just calling it, he is going to be in for surprises. -- David Kastrup