[gambit-list] Js backend example doesn't work

Ben ben at srctxt.com
Mon Nov 11 05:12:52 EST 2019


quick update, problem is solved, here is the reply from Marc:

feeley commented 13 days ago
The problem is due to the "incorrect" declarations at the top of the files app.scm and lib.scm. The declarations should be:

(declare (standard-bindings) (extended-bindings) (not safe) (not run-time-bindings))
(declare (not standard-bindings append for-each))
The second line is important because the append and for-each global variables don't have the standard bindings provided by the Gambit runtime library. Previously the second declaration was not needed because the compiler did not optimize calls to append and for-each, but now the compiler converts (append ...) to (##append ...) when append has the standard bindings and (not safe) is also declared (in this case, calling ##append avoids the type checks on the parameters). So alternatively you could remove the (not safe) declaration.

from: https://github.com/gambit/gambit/issues/419#issuecomment-547400994

On Tue, Oct 29, 2019, at 10:03 AM, Ben wrote:
> Repling to my own post ...  I think I should have make an issue ticket 
> on github rather than posting here, because at least for me, this looks 
> like a bug. https://github.com/gambit/gambit/issues/419
> 
> On Tue, Oct 29, 2019, at 9:39 AM, Ben wrote:
> > Hi,
> > 
> > I try to run the example for Js backend from 
> > 
> > https://mailman.iro.umontreal.ca/pipermail/gambit-list/2019-July/009103.html
> > 
> > All the code compiles but I get a runtime error from node
> > 
> > ----------------
> > gambit-test/linked_app.js:1066
> >     return g_peps["##append"]();
> >                              ^
> > TypeError: g_peps.##append is not a function
> > -------------------
> > 
> > I guess it has something to do with the name 'append'? That this name 
> > cannot be overwritten in a local library?
> > 
> > Regards Ben
> > 
> > 
> > _______________________________________________
> > Gambit-list mailing list
> > Gambit-list at iro.umontreal.ca
> > https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list
> >
> 
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list
>




More information about the Gambit-list mailing list