[gambit-list] handling of macros

Christian christian at pflanze.mine.nu
Mon Aug 8 12:00:00 EDT 2005


Hello

Some questions:

(the first two of those may be rather general scheme philosophy
questions)

- why are DSSSL style argument declarations not allowed in
define-macro?

- why is there no (define-macro foo (lambda(...)...)) form? Is there
a lowlevel variant for setting runtime and compiletime macro bindings
to some lambda?

- is there a way to get at the converter lambda from a (runtime-)macro
definition?

- I need a way to unset a macro definition, so that the corresponding
name can be used as normal function/variable binding from there on.

- I'd like to be able to scan a namespace for all bindings and macro
bindings. For example for readline completion. (And to be able to
remove all runtime macros.)

- how can I macro-expand code with the original context? Until now
  I've used

    (caddr (##decompile (eval `(lambda() ,code))))

  but code is eval'ed in a new lexical context of course.
  (I haven't understood how to use ##macro-expand. I would be grateful
  for any help for understanding the sources. How do the cte
  (=compile-time environment?) and such work? What's the exact
  concept?)

I want macro expansion for writing macros which expand their arguments
before working on them. For playing with optimizations (kind of like
optimizing mini-compilers).

- is there a way to preserve the line/column numbering of source code
which is "wrapped" by macros? For something like for example (receive
(a b) (code1) code2) it would be nice if when an error happens in
code1 or code2, the error message didn't just mention the line/column
of the opening paren of the receive form, but the line/column where
the relevant part of code1 or code2 is in the original file.

Thanks,
Christian.




More information about the Gambit-list mailing list