(no title)
tonyg | 1 year ago
I don't think this is the case. Consider Kernel's
($lambda (f) (f (+ 3 4)))
Is `f` a fexpr or a closure? We cannot know until runtime.tonyg | 1 year ago
I don't think this is the case. Consider Kernel's
($lambda (f) (f (+ 3 4)))
Is `f` a fexpr or a closure? We cannot know until runtime.
kazinator|1 year ago
If it's unbound, we assume that it will be function and compile accordingly. We make a note that we did this.
If, by the end of the compilation unit, a definition of f has not been seen, we issue a warning. If a conflicting definition is seen, like a macro or fexpr, we also issue a warning.
(We provide a macro with-compilation-unit that the programmer or their build system can use to clump together multiple files into one compilation unit for the purpose of generating these kinds of diagnostics related to definitions.)
We carefully document all of this in our reference manual, in a section about how compilation semantics can differ from interpretation semantics.
This isn't rocket science. Been there, done that.
Xmd5a|1 year ago
kazinator|1 year ago