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

Read macros vs. macro-->declare



I agree that read macros aren't the right thing, i.e. something like
#<MACRO>(FOO ...) expanding at read time into (DECLARE (SPECIAL FROB)
(INTEGER FROB)) loses because it forces the macro-expansion environment
to be the read environment instead of the compiler environment, which
may not be exactly the same.  But would it be feasible to have a
continuation read-macro that produces a scheme-style continuation that
gets evaluated the first time anybody tries to perform an operation
upon it, even a trivial one like PAIRP? Then you could with this single
facility have macros that expanded into arglists, or into declarations,
or into arbitrary sequences of forms spliced into bodies of functions,
or into COND clauses, or into function names, or into type names,
or into any other sub-expression or splice-list? The programmer would
have to be careful not to try to do an operation on the continuation-ptr
until such time as the correct macro-expansion operation is in effect.
-------