guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Goops, set! and define-syntax throuble


From: Mikael Djurfeldt
Subject: Re: Goops, set! and define-syntax throuble
Date: 07 Mar 2001 15:19:02 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Martin Grabmueller <address@hidden> writes:

> > (my-begin 
> >     (set! a 5)
> >     (set! (somevar b) 5) ;; <- this line is causing throuble
> >     (set-somevar b 5))
> > -------------------------- snip --------------------------
> 
> The syntax (set! <setter> <value>) is a Guile extension (called
> gerneralized set!), which is not supported by syntax-case, apparently.
> syntax-case only allows the R5RS set! syntax.

This bug has been fixed in CVS Guile.  Please replace ice-9/psyntax.ss
and ice-9/psyntax.pp with the following two files:

Attachment: psyntax.ss
Description: ice-9/psyntax.ss

Attachment: psyntax.pp
Description: ice-9/psyntax.pp

Rob, can you install this in the libguile9 Debian package?  It
actually fixes a bug in libguile9, independently of GOOPS, since the
generalized set! is Guile syntax as well.

Unfortunately, the rest of the GOOPS syntax (define-class, class etc)
isn't supported either.  Basically, the syntax-case system isn't yet
fully integrated in Guile.

One solution is to add core syntax forms for the GOOPS macros.
Another is to make Guile and syncase macros happily coexist.  I'll see
if I can find some solution to this...

> > If I move "(set! (somevar b) 5)" outsite of my-begin it works, if I
> > use set-somevar instead it also works, only when using set! inside
> > my-begin it fails.  Anybody knows what is going on here?
> 
> The reason seems to be that the expansion of syntax is only invoked
> inside of a syntax-case macro expansion.

The proper way to invoke the syntax-case macro system is

  (use-syntax (ice-9 syncase))

It then syntax-case-expands all syntax.

  (use-module (ice-9 syncase))

gives expansion only within syntax-case syntactic forms.

/mdj

reply via email to

[Prev in Thread] Current Thread [Next in Thread]