This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
compiling syntax and macro
- To: guile at sourceware dot cygnus dot com
- Subject: compiling syntax and macro
- From: Keisuke Nishida <kxn30 at po dot cwru dot edu>
- Date: 31 Jul 2000 02:28:58 -0400
Hello,
I started trying to compile macros and syntaxes for my VM.
Guile does evaluate like this:
guile> (define foo let)
guile> (foo ((a 1)) a)
1
So syntax is an object rather than a name. This is conceptually clean
and I like it, but thinking of how to compile these expressions, I
realized that there is no way to statically know what name is associated
with what macro. For example,
(define foo (if (> (current-time) 100000) let let*))
(foo ((a 1) (b a)) b)
I can't compile this. It is possible to generate a bytecode that
dynamically evaluates these expressions and works correctly, but it will
be less efficient and more complicated than statically analyzed version.
So what about defining macros only by using define-syntax and evaluating
them at compile time? I suppose R5RS doesn't require the above behavior
Guile does now.
Thanks,
Keisuke Nishida