From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: bug in syncase Date: 21 Nov 2002 20:22:45 +0000 Sender: guile-devel-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037912810 32575 80.91.224.249 (21 Nov 2002 21:06:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 21 Nov 2002 21:06:50 +0000 (UTC) Cc: Guile Development Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18EyXA-0008TA-00 for ; Thu, 21 Nov 2002 22:06:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EyVW-0000Ua-00; Thu, 21 Nov 2002 16:05:07 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18EyUU-0008PB-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 16:04:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18EyUN-0008MB-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 16:04:00 -0500 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EyUM-0008Ko-00 for guile-devel@gnu.org; Thu, 21 Nov 2002 16:03:54 -0500 Original-Received: from laruns.ossau.uklinux.net (bts-0886.dialup.zetnet.co.uk [194.247.51.118]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id gALL3pS07760; Thu, 21 Nov 2002 21:03:51 GMT Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (localhost [127.0.0.1]) by laruns.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id 0A5A4DC129; Thu, 21 Nov 2002 20:22:46 +0000 (GMT) Original-To: Dirk Herrmann In-Reply-To: Original-Lines: 78 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1737 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1737 >>>>> "Dirk" == Dirk Herrmann writes: Dirk> In the current implementation, the decision, how the @fop Dirk> expression should be changed, would be taken when foo was Dirk> set to 2. In contrast, with my memoization phase I would Dirk> like to perform the transformation (including the expansion Dirk> of the transformer-macro expression) at the point where bar Dirk> gets defined. Dirk> In other words: Are there any statements about _when_ the Dirk> expansion of the @fop macro and the transformer-macro should Dirk> happen? I would say that there are no statements except that transformed Elisp code should behave in the same way as Emacs. In Emacs: (setq foo 1) 1 (defun fn () 'function-value) fn (defun bar () (if (= foo 2) (fn))) bar (bar) nil (defmacro fn () ''macro-value) fn (bar) nil (setq foo 2) 2 (bar) macro-value (defun fn () 'function-value) fn (bar) function-value In Guile (current unstable CVS): guile> (use-modules (lang elisp base)) guile> (define-module (lang elisp base)) # guile> (setq foo 1) 1 guile> (defun fn () 'function-value) fn guile> (defun bar () (if (= foo 2) (fn))) bar guile> (bar) #nil guile> (defmacro fn () ''macro-value) guile> (bar) #nil guile> (setq foo 2) 2 guile> (bar) macro-value guile> (defun fn () 'function-value) fn guile> (bar) macro-value So Guile as it stands is already wrong in the last result. It looks as though Emacs behaves as though there is no memoization at all. It strikes me that macros have two meanings that are confused. 1 is to prevent automatic evaluation of arguments. 2 is to gain execution efficiency by expanding/transforming code at read time. Apparently Emacs does 1 but not 2. I wonder if Guile's macros should offer explicit control over which of 1 and 2 should apply. Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel