From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [patch] variable datums with syncase transformer Date: Wed, 05 Mar 2008 15:59:37 +0100 Message-ID: <878x0x5i92.fsf@gnu.org> References: <1197619616.5218.34.camel@nocandy.dyndns.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204729256 12992 80.91.229.12 (5 Mar 2008 15:00:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2008 15:00:56 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 05 16:01:23 2008 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 1JWv6s-00014H-C3 for guile-devel@m.gmane.org; Wed, 05 Mar 2008 16:00:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWv6K-0002Gj-Hy for guile-devel@m.gmane.org; Wed, 05 Mar 2008 10:00:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWv6A-0002CH-00 for guile-devel@gnu.org; Wed, 05 Mar 2008 10:00:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWv62-00025g-52 for guile-devel@gnu.org; Wed, 05 Mar 2008 10:00:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWv61-00025R-SO for guile-devel@gnu.org; Wed, 05 Mar 2008 09:59:53 -0500 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 1JWv61-00036K-KK for guile-devel@gnu.org; Wed, 05 Mar 2008 09:59:53 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JWv5s-0002CE-B1 for guile-devel@gnu.org; Wed, 05 Mar 2008 14:59:44 +0000 Original-Received: from 193.50.110.109 ([193.50.110.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Mar 2008 14:59:44 +0000 Original-Received: from ludo by 193.50.110.109 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Mar 2008 14:59:44 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.109 X-Revolutionary-Date: 16 =?iso-8859-1?Q?Vent=F4se?= an 216 de la =?iso-8859-1?Q?R=E9volution?= 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: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:z1MTsG+JADFzO9P7gbSDt6QUqlY= X-detected-kernel: by monty-python.gnu.org: 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:7058 Archived-At: Hi, I just rediscovered this message, sorry for the long delay. Stephen Compall writes: > Issue most easily explained with a simple reproduction: > > guile> (use-syntax (ice-9 syncase)) > guile> (@ (guile) car) > ERROR: invalid syntax #> OTOH, you can (should?) use `use-modules': guile> (use-modules (ice-9 syncase)) guile> (define-syntax foo (syntax-rules () ((_ x ...) (x ...)))) guile> foo # guile> (foo + 2 3) 5 guile> (@ (guile) car) # I don't even understand what the difference is between using `use-modules' and `use-syntax' for `(ice-9 syncase)'. There's this `expansion-eval-closure' fluid that's being used, but it doesn't seem to change the module where top-level bindings are resolved, as one might think: guile> (define-module (x) :use-syntax (ice-9 syncase)) # guile> (define (+ . args) 'plus) guile> (define-syntax foo (syntax-rules () ((_ x ...) (+ x ...)))) guile> (export-syntax foo) guile> (foo 1 2 3) plus guile> (set-current-module (resolve-module '(guile-user))) # guile> (use-modules (x)) guile> (foo 1 2 3) 6 ;; <--- `+' is resolved in `(guile-user)', not in `(x)' This per-module syntax transformer, `use-syntax' and friends all look pretty pointless to me. Thanks, Ludovic.