Yes. That’s handled when you link with the universal library (in fact the current univ-lib will raise an exception in that case). But if this is all you want to handle, just write your code like this:
(define (##apply-global-with-procedure-check-nary gv . args) (declare (standard-bindings)) (println (list "*** ERROR -- call to unbound global variable " gv)) (0)) ;; really crash!
(foo 1 2 3)
The generated JS code calls the ##apply-global-with-procedure-check-nary function when a non-procedure bound to a global variable is called.
Marc
On Feb 3, 2015, at 4:51 PM, Blake McBride blake@mcbride.name wrote:
Greetings,
When running a JS target, if an unknown function is called, would it be possible to say something like:
Error: call to unknown function XYZ
Rather than:
/home/blake/z/gambit/fib.js:348 pc = pc(); ^ TypeError: undefined is not a function at gambit_trampoline (/home/blake/z/gambit/fib.js:348:10) ......
Thanks.
Blake McBride