unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* wrapping `define-syntax'
@ 2009-04-12 22:55 Julian Graham
  2009-04-13  9:35 ` Neil Jerram
  2009-04-15 11:25 ` Andy Wingo
  0 siblings, 2 replies; 8+ messages in thread
From: Julian Graham @ 2009-04-12 22:55 UTC (permalink / raw)
  To: Guile Users

Hi Guilers,

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.  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

I've also tried doing:

  (define canonical-define-syntax
    (procedure->memoizing-macro (macro-transformer (@ (ice-9 syncase)
define-syntax))))

...which produces, when I try to use it:

  ERROR: unknown kind of macro

So I'm curious: regardless of whether what I'm trying to do is a good
idea, is it feasible -- and if so, what's the right way to do it?


Regards,
Julian




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-18 20:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-12 22:55 wrapping `define-syntax' Julian Graham
2009-04-13  9:35 ` Neil Jerram
2009-04-13 13:39   ` Julian Graham
2009-04-13 13:55   ` Julian Graham
2009-04-15 11:41     ` Andy Wingo
2009-04-18 20:52       ` Julian Graham
2009-04-15 11:25 ` Andy Wingo
2009-04-17  3:42   ` Julian Graham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).