From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Updates/Questions Date: Sun, 29 Aug 2010 02:45:19 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1283067954 8051 80.91.229.12 (29 Aug 2010 07:45:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 Aug 2010 07:45:54 +0000 (UTC) Cc: Michael Lucy , guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Aug 29 09:45:51 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 1OpcaH-0001Mu-Ti for guile-devel@m.gmane.org; Sun, 29 Aug 2010 09:45:50 +0200 Original-Received: from localhost ([127.0.0.1]:56291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpcaC-0001Fz-US for guile-devel@m.gmane.org; Sun, 29 Aug 2010 03:45:41 -0400 Original-Received: from [140.186.70.92] (port=56503 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpcZy-0001CW-6J for guile-devel@gnu.org; Sun, 29 Aug 2010 03:45:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OpcZu-00073i-Ji for guile-devel@gnu.org; Sun, 29 Aug 2010 03:45:24 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:38944) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OpcZu-00073d-GR for guile-devel@gnu.org; Sun, 29 Aug 2010 03:45:22 -0400 Original-Received: by qyk2 with SMTP id 2so4705049qyk.0 for ; Sun, 29 Aug 2010 00:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pP29NaHreSn5fcYoz/WVvC9SPjWvF3KvVyZ3YW2mAUA=; b=QI6zoa+goza6DuSdij+eAFH73cJQ00Z9m6pqEeDL8tWls2zwX5w8xaDmvlYwO3+vHe 8KJbGhmYBIK7MLr8D86YaglGQmUwd3VjdadV/Kj1qwoULY9NYDIHtsjhOcVTSDfEYFTZ Lv+VMFbpXXd0ZDdGM4ptpBFCCKnxJJsCa48Ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Sb2D4zjH4udUQoKsQQmCrhK6nyl8htWG7hB1HTVBRsCBfr6Ytirq6yRmL9NcUGBG1E 8+ud4N2N6qXHTC/oRdMxyUnjZ5TssRo+UfkKZ5f48/Z9K5bXiv+5Q6JJV+hTWXq5Y9Jh TyH3nXmId9PuzwFx1upS6LusghaQWLlc9301s= Original-Received: by 10.224.45.134 with SMTP id e6mr1811772qaf.300.1283067919361; Sun, 29 Aug 2010 00:45:19 -0700 (PDT) Original-Received: by 10.229.242.4 with HTTP; Sun, 29 Aug 2010 00:45:19 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:10807 Archived-At: So is there a sort of ETA on when this will be part of Guile? On Fri, Aug 20, 2010 at 4:30 PM, Andy Wingo wrote: > 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 = wrote: >>> 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. =A0This >>> turned out to be a little difficult to debug, however (read: I was >>> unable to make the code actually work). =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. =A0Is this a problem? > > Yep! But it probably won't be a big deal to fix. > >>> Another question about module namespaces: =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). =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: > > =A0 =A0(define-module (a) > =A0 =A0 =A0#:export (b)) > > =A0 =A0(define-syntax b > =A0 =A0 =A0(lambda (x) > =A0 =A0 =A0 =A0(syntax-case x () > =A0 =A0 =A0 =A0 =A0((_ exp) > =A0 =A0 =A0 =A0 =A0 #'(c exp))))) > > =A0 =A0(define-syntax c > =A0 =A0 =A0(syntax-rules () > =A0 =A0 =A0 =A0((_ exp) (car exp)))) > > =A0 =A0(define-module (d) > =A0 =A0 =A0#:use-module (a)) > > =A0 =A0(b '(1 2 3)) > =A0 =A0 =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 > -- > http://wingolog.org/ > >