This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
forward reference to syntax
- To: kawa at sourceware dot cygnus dot com
- Subject: forward reference to syntax
- From: Doug Orleans <dougo at ccs dot neu dot edu>
- Date: Sat, 31 Mar 2001 21:27:09 -0500 (EST)
It would be nice if this worked:
#|kawa:1|# (define (foo) (bar))
#|kawa:2|# (define-syntax bar (syntax-rules () ((bar) 42)))
#|kawa:3|# (foo)
Invalid parameter, was: kawa.lang.Macro
java.lang.ClassCastException: kawa.lang.Macro
at gnu.mapping.Constraint.getProcedure(Constraint.java:28)
at gnu.mapping.Binding.getProcedure(Binding.java:23)
at atInteractiveLevel.foo(Unknown Source)
at atInteractiveLevel.apply0(Unknown Source)
at gnu.expr.ModuleBody.applyN(ModuleBody.java:93)
at gnu.expr.ModuleMethod.applyN(ModuleMethod.java:61)
at gnu.expr.ApplyExp.eval(ApplyExp.java:38)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:38)
at kawa.Shell.run(Shell.java:85)
at kawa.Shell.run(Shell.java:35)
at kawa.Shell.run(Shell.java:19)
at kawa.repl.main(repl.java:356)
The other order of definition works fine, of course:
#|kawa:4|# (define (foo) (bar))
#|kawa:5|# (foo)
42
Is there any chance of this being changed, i.e. forward references to
syntax being treated the same as forward references to procedures? Or
is this disallowed by R5RS or something? If not, at least a more
informative error message would be nice, if possible...
--dougo@ccs.neu.edu