<div dir="ltr">Thanks!  That's what I needed.  I'll get back to you.<div><br></div><div>Blake</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 4, 2015 at 10:25 AM, Francois Magnan <span dir="ltr"><<a href="mailto:magnan@categoricaldesign.com" target="_blank">magnan@categoricaldesign.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi,</div><div><br></div><div>The univ-lib is a git repo… </div><div><br></div><a href="https://github.com/feeley/univ-lib.git" target="_blank">https://github.com/feeley/univ-lib.git</a><div><br></div><div>You must install it in your Gambit distribution directory. </div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Francois</div></font></span><div><div class="h5"><div><br></div><div><br><div><blockquote type="cite"><div>On Feb 4, 2015, at 8:43 AM, Francois Magnan <<a href="mailto:magnan@categoricaldesign.com" target="_blank">magnan@categoricaldesign.com</a>> wrote:</div><br><div><div style="word-wrap:break-word">Hi Blake,<div><br></div><div>1) Not really, appart from this mailing list from which we could extract some wiki entries. If you can you are welcome to contribute.</div><div>2) Univ-lib is the implementation of scheme that can compile to various architectures (targets), so you will need it to do any serious stuff with the js target.</div><div>3) Yes this is it. Here is a sample loader script:</div><div><br></div><div><br></div><div><div>File: loader.scm </div><div>——————————————————————</div><div>(declare (standard-bindings)</div><div>         (extended-bindings)</div><div>         ;(fixnum) </div><div>         (not safe))</div><div><br></div><div>(declare (not inline-primitives equal?))</div><div><br></div><div><br></div><div>; include Marc's code</div><div>(##include  “~/gambit/univ-lib/lib/lib.scm")         </div></div><div><br></div><div>; here you include your own modules</div><div><div>(include "Sentio.scm")</div><div>(include "Home.scm")</div><div>(include "Sentio-Localization.scm")</div><div>(include "Graph.scm")</div><div>(include "State-transitions.scm")</div><div>(include "Sentio-Forms.scm")</div><div>(include "Media.scm")</div></div><div><div>——————————————————————</div></div><div><br></div><div><br></div><div>You need to change the path to to univ-lib.scm</div><div><br></div><div>Then you compile this file with: </div><div><br></div><div><div>/usr/local/Gambit-C/bin/gsc -:d-,f8,t8,-8 -c -target js loader.scm</div></div><div><br></div><div>I’m not sure now if this file in part of the gambit repo actually since this is so edgy. I will send you the file in a separate personal email to spare the list.</div><div><br></div><div>François</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><blockquote type="cite"><div>On Feb 4, 2015, at 7:10 AM, Blake McBride <<a href="mailto:blake@mcbride.name" target="_blank">blake@mcbride.name</a>> wrote:</div><br><div><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><font color="#888888"><br>
Marc<br>
</font></span><div><div><br>
> On Feb 3, 2015, at 4:51 PM, Blake McBride <<a href="mailto:blake@mcbride.name" target="_blank">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>
_______________________________________________<br>Gambit-list mailing list<br><a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br><a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>Gambit-list mailing list<br><a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br><a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>