guile-user
[Top][All Lists]
Advanced

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

Re: wrapping `define-syntax'


From: Neil Jerram
Subject: Re: wrapping `define-syntax'
Date: Mon, 13 Apr 2009 10:35:15 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Julian Graham <address@hidden> writes:

> Hi Guilers,

Hi!

> For the purpose of some experiments I've been doing with integrating
> R6RS libraries, I've been trying to figure out ways to wrap
> `define-syntax' so that I can do things like add bindings to a
> module's eval closure before evaluating a macro definition.

Can you give an example?

>  As part
> of this mechanism, I need to be able to save the original transformer
> for `define-syntax' so that I can delegate to it.  When I run the
> following code (either in master or Andy Wingo's "syncase" branch)...
>
>   (use-modules (ice-9 syncase))
>   (define canonical-define-syntax (@ (ice-9 syncase) define-syntax))
>   (canonical-define-syntax foo (syntax-rules () ((_) 'foo)))
>
> ...I get:
>
>   ERROR: In procedure vm-run:
>   ERROR: VM: Stack overflow

Hmm.  I don't really have much idea... but given that define-syntax is
syntax, does (define-syntax canonical-define-syntax define-syntax)
work any better?  Also does it make any difference if you use
use-syntax instead of use-modules ?

Regards,
        Neil




reply via email to

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