From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Re: how to implement mutual recursive parsers in syntax-parse Date: Fri, 18 May 2012 23:58:49 +0200 Message-ID: References: <87obppmgr8.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9340f2d3d51b304c056a88d X-Trace: dough.gmane.org 1337378345 5811 80.91.229.3 (18 May 2012 21:59:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 May 2012 21:59:05 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 18 23:59:04 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SVVCN-0007ri-OG for guile-devel@m.gmane.org; Fri, 18 May 2012 23:58:59 +0200 Original-Received: from localhost ([::1]:37578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVVCN-00062s-7G for guile-devel@m.gmane.org; Fri, 18 May 2012 17:58:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVVCJ-00062m-HQ for guile-devel@gnu.org; Fri, 18 May 2012 17:58:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVVCH-0002Yy-FF for guile-devel@gnu.org; Fri, 18 May 2012 17:58:55 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:54802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVVCH-0002Ym-8A for guile-devel@gnu.org; Fri, 18 May 2012 17:58:53 -0400 Original-Received: by yenm7 with SMTP id m7so4039280yen.0 for ; Fri, 18 May 2012 14:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GJPuSE9eSk9gm8Vpe4kukkMD2bYuMTiaIC8WGMIlzew=; b=mri+6c9OYeYG1KKRW+lYBejGks9yMt70v46LA/kQFV27i1u7FlbsFbQjx39DvEMMbC hQzeqVqhOfJ+BwdU2axRFe4PoU0X6L+EzFM2Nvd2jRK1XIPzhyhG+BKeJdueArfTxv+Y SOAuFhzZKi4VzfRRyLDCswlzm/eeCVLl923ZSkrMnfkYyg0GaBgSUgBs3X1B6Pu92v4h EhMwfp/HLG8igoVXYCzmUxXqC1Rb5EuvfjC7lxOHjaVki8ZQuY37Nah4Xifl7EtfmZFf BOyGIJL+fLZDrIhURSJMrxNv9YiSZjDS9Hwl/ADTFqb9CPAwMTt4IyLxhq9cvhkntg6Z YeGw== Original-Received: by 10.50.186.134 with SMTP id fk6mr2050865igc.22.1337378329153; Fri, 18 May 2012 14:58:49 -0700 (PDT) Original-Received: by 10.50.242.102 with HTTP; Fri, 18 May 2012 14:58:49 -0700 (PDT) In-Reply-To: <87obppmgr8.fsf@pobox.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.169 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:14488 Archived-At: --14dae9340f2d3d51b304c056a88d Content-Type: text/plain; charset=ISO-8859-1 I manage to make it work under master as well as guile-2.0 But the mutual code does not work. On the other hand what you said some months ago was correct and I believe that we do not need special constructs for local syntax-classes anymore which if correct is a plus. Please read the mail again is master supposed to expand and evaluate all the syntax defines before expanding the defines? And if a plain macro is encountered at the toplevel it is expanded as well in the first run. I don't understand exactly how the expansion progresses so can you describe or link to a description? Regards Stefan On Tue, May 15, 2012 at 8:38 PM, Andy Wingo wrote: > On Mon 14 May 2012 21:13, Stefan Israelsson Tampe > writes: > > > (begin > > (define parser-a code-a ...) > > (define-syntax a spec-a)) > > > > (begin > > (define parser-b code-b ...) > > (define-syntax b spec-b)) > > > > In racket they manage to evaluate the define-syntax forms before the > define-forms cause in the expansion > > of code-a amd code-b they need the spec's spec-a and spec-b. > > > > Do you have any ideas how solve this. I do have a fix for problem but it > is not easy to use. > > Have you tried master? If I understand you correctly I think it should > work there. > > Andy > -- > http://wingolog.org/ > --14dae9340f2d3d51b304c056a88d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I manage to make it work under master as well as guile-2.0
But the mutua= l code does not work. On the other hand what you said
some months ago wa= s correct and I believe that we do not need special constructs
for local= syntax-classes anymore which if correct is a plus.

Please read the mail again is master supposed to expand and evaluate al= l the syntax
defines before expanding the defines? And if a plain macro = is encountered at the toplevel
it is expanded as well in the first run. = I don't understand exactly how the expansion progresses so can you desc= ribe or link to a description?

Regards
Stefan

On Tue, May 15, 20= 12 at 8:38 PM, Andy Wingo <wingo@pobox.com> wrote:
On Mon 14 May 2012 21:13, Stefan Israelsson Tampe <stefan.itampe@gmail.com> wri= tes:

> (begin
> =A0=A0 (define parser-a code-a ...)
> =A0=A0 (define-syntax a spec-a))
>
> (begin
> =A0=A0 (define parser-b code-b ...)
> =A0=A0 (define-syntax b spec-b))
>
> In racket they manage to evaluate the define-syntax forms before the d= efine-forms cause in the expansion
> of code-a amd code-b they need the spec's spec-a and spec-b.
>
> Do you have any ideas how solve this. I do have a fix for problem but = it is not easy to use.

Have you tried master? =A0If I understand you correctly I think it sh= ould
work there.

Andy
--
http://wingolog.org/=

--14dae9340f2d3d51b304c056a88d--