This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

forward reference to syntax


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]