<div dir="ltr">Greetings,<div><br></div><div>Your response leads to several questions as follows:</div><div><br></div><div>1.  Is there any documentation on all the stuff you have been telling regarding JS?  (It is okay if there is not.  I just don't want to keep bugging you if it's all documented and I just need to read it.)</div><div><br></div><div>2.  I don't know what univ-lib is.  For example:</div><div><br></div><div><div>blake@sony-linux-laptop /usr/local/Gambit-C $ find . |grep -i univ</div><div>blake@sony-linux-laptop /usr/local/Gambit-C $ </div></div><div><br></div><div><div>blake@sony-linux-laptop ~/Backup/gambit.git $ find . |grep -i univ</div><div>./gsc/_t-univ.o</div><div>./gsc/_t-univ.scm</div><div>./gsc/_t-univ.c</div><div>blake@sony-linux-laptop ~/Backup/gambit.git $ </div></div><div><br></div><div>Are you talking about gsc/_t-univ.scm?</div><div><br></div><div><br></div><div>3.  With respect to JavaScript, I am not sure what you mean by "<span style="font-size:13px">when you link with the universal library".  Do you mean load the universal library first?  Also, which file is that?  I'd rather not start creating a bunch of cover functions for standard scheme stuff if I don't have to.</span></div><div><span style="font-size:13px"><br></span></div><div>I am sorry about all of these questions.  For reasons I mentioned elsewhere, JavaScript has become a very important platform.  It may not be bad as a small scripting language, but it certainly is not a full-bore production language like it is being used as.  I am looking into leveraging off of Gambit Scheme if possible.  Presumably, once I get a critical mass of functioning code and understanding, I will be able to work without all these pestering questions.</div><div><br></div><div>Thanks!</div><div><br></div><div>Blake</div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 3, 2015 at 4:26 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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:<br>
<br>
  (define (##apply-global-with-procedure-check-nary gv . args)<br>
    (declare (standard-bindings))<br>
    (println (list "*** ERROR -- call to unbound global variable " gv))<br>
    (0)) ;; really crash!<br>
<br>
  (foo 1 2 3)<br>
<br>
The generated JS code calls the ##apply-global-with-procedure-check-nary function when a non-procedure bound to a global variable is called.<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Feb 3, 2015, at 4:51 PM, Blake McBride <<a href="mailto:blake@mcbride.name">blake@mcbride.name</a>> wrote:<br>
><br>
> Greetings,<br>
><br>
> When running a JS target, if an unknown function is called, would it be possible to say something like:<br>
><br>
> Error: call to unknown function XYZ<br>
><br>
> Rather than:<br>
><br>
> /home/blake/z/gambit/fib.js:348<br>
>     pc = pc();<br>
>          ^<br>
> TypeError: undefined is not a function<br>
>     at gambit_trampoline (/home/blake/z/gambit/fib.js:348:10)<br>
>     ......<br>
><br>
><br>
> Thanks.<br>
><br>
> Blake McBride<br>
><br>
<br>
</div></div></blockquote></div><br></div></div>