[gambit-list] Javascript Backend

Marc Feeley feeley at iro.umontreal.ca
Fri May 16 09:36:40 EDT 2014


On May 16, 2014, at 9:29 AM, Mikael <mikael.rcv at gmail.com> wrote:

> Dear Marc,
> 
> Did ##inline-host-expression (and  ##inline-host-statement) change name recently?
> 
> On 4.7.2 it compiles to an ordinary procedure call.
> 
> Test case: (define js (##inline-host-expression "myprocedure(myargument)"))
> compiles to: ....  return Gambit_glo['##inline-host-expression']();
> 
> This is even while grep -r inline-host-expression gambit/* gives:
> 
> ./gambit/gsc/_t-univ.scm:(univ-prim-proc-add! '("##inline-host-expression" (1) #t 0 0 (#f) extended))
> ./gambit/gsc/_t-univ.scm:(univ-define-prim "##inline-host-expression" #f
> ./gambit/gsc/_t-univ.scm:        (compiler-internal-error "##inline-host-expression requires a constant string argument"))))
> 
> so it seems to be there somehow.
> 
> Thanks and best regards,
> Mikael

You need to

(declare (extended-bindings) (not safe))

for those procedures to be inlined.

I may change the “safety” of those procedures though because others have had similar problems.

Also I will add tests to avoid JS-level errors when calling an undefined global variable.

Marc




More information about the Gambit-list mailing list