From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Updates/Questions Date: Fri, 20 Aug 2010 14:30:04 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282414169 7119 80.91.229.12 (21 Aug 2010 18:09:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Aug 2010 18:09:29 +0000 (UTC) Cc: guile-devel@gnu.org To: Michael Lucy Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Aug 21 20:09:26 2010 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.69) (envelope-from ) id 1OmsVP-0002rA-3f for guile-devel@m.gmane.org; Sat, 21 Aug 2010 20:09:23 +0200 Original-Received: from localhost ([127.0.0.1]:57018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmsVN-0002nq-Qm for guile-devel@m.gmane.org; Sat, 21 Aug 2010 14:09:21 -0400 Original-Received: from [140.186.70.92] (port=41538 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmsVB-0002ng-Us for guile-devel@gnu.org; Sat, 21 Aug 2010 14:09:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmsUd-0000M0-E3 for guile-devel@gnu.org; Sat, 21 Aug 2010 14:08:36 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:52349 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmsUd-0000Lq-Az for guile-devel@gnu.org; Sat, 21 Aug 2010 14:08:35 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 4F227CF68D; Sat, 21 Aug 2010 14:08:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=lR/8rQNIkBFr 0hwNVR0asD+0hCE=; b=VOsdPi69CPNaxV8K6hSoRyt1EseQCAbsSkRzgUDLXxVv yUOtYX1eIzBaVPPtI5Tsks8MEW0Es5ASxvvb3kM6MI0JBG7egRDdVPBbNoM4bT2q HgP5kFskNamn4rAq4Y+BO5l6JjQK7xPAMq+xc2vbn4b1DBs1NobGWgFCH6AmhrY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=AZnfZY eKRAWlfReF3rn/ssqgL7xcmgj7+wWsZHRkEDKAM9bAevI40Ua8j72zhKLo4DJ4Fx G9vfjW4d7HfAp/6NLErlTVrt06cQLiTaeL/HTj5/RuDyov2TXH0sqqCLoOP4iuOT ZHbjOUo30aUUyCOYktIG6JHUyxMKdnhI6evWA= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3A501CF68B; Sat, 21 Aug 2010 14:08:32 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [132.204.32.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id F0530CF689; Sat, 21 Aug 2010 14:08:30 -0400 (EDT) In-Reply-To: (Michael Lucy's message of "Fri, 6 Aug 2010 01:40:13 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 1BA35C48-AD4F-11DF-B6D6-9056EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:10784 Archived-At: Hello, Mr. Lucy! At some point I might escape the need to apologize at every mail I send, but until then: sorry for the late response! On Thu 05 Aug 2010 23:40, Michael Lucy writes: > On Wed, Jul 28, 2010 at 12:13 AM, Michael Lucy w= rote: >> I've officially eliminated the last define-macro expression. >> >> However, I get the feeling that things may not be exactly as desired. >> The original program made extensive use of functions in building the >> macros, and I originally tried to replace these with macros. =C2=A0This >> turned out to be a little difficult to debug, however (read: I was >> unable to make the code actually work). =C2=A0I eventually abandoned this >> and just made datum->syntax calls. I'll have to check and see what the deal is. However note that with procedural macros you can still use helper functions that operate on syntax objects, destructing them via syntax and building up syntax objects using `syntax'. Think of a procedural macro as consisting of one helper function :) >> The downside is that one doesn't get all the same benefits of >> referential transparency, so I still have gensyms in the functions >> etc. =C2=A0Is this a problem? Yep! But it probably won't be a big deal to fix. >> Another question about module namespaces: =C2=A0I have some syntax that = I'd >> like to be available to code generated by macros in my module, but >> which I'd rather not export to the user (to avoid clobbering their >> functions). =C2=A0Is there a standard way of doing this? Phil mentioned @ and @@, but the normal case is that things Just Work, due to the referential-transparency-preserving properties of syntax-case. For example: (define-module (a) #:export (b)) (define-syntax b (lambda (x) (syntax-case x () ((_ exp) #'(c exp))))) (define-syntax c (syntax-rules () ((_ exp) (car exp)))) (define-module (d) #:use-module (a)) (b '(1 2 3)) =3D> 1 You see that the expansion of `(b '(1 2 3))' in the module `(d)' produced a reference to `c' -- but `c' is private in the `(a)' module. Barring the use of datum->syntax, syntax-case macros *scope free identifiers within the lexical conext and module in which they appear*. That's what "hygiene" is. Anyway, I hope to have time to poke this next week. I'm very much looking forward to having a good PEG parser! Cheers, Andy --=20 http://wingolog.org/