Assigning a value to mem instead of a function ((define (example) (mem 0.5))) gives this confusing and unhelpful output (which is not registered as an error):
(function ()
{
var str = JSON.stringify(arguments)
var val = cache[str]
if (val === undefined)
{
val = fn.apply(this, arguments)
cache[str] = val
}
return val
} function ()
{
var str = JSON.stringify(arguments)
var val = cache[str]
if (val === undefined)
{
val = fn.apply(this, arguments)
cache[str] = val
}
return val
} function ()
{
var str = JSON.stringify(arguments)
var val = cache[str]
if (val === undefined)
{
val = fn.apply(this, arguments)
cache[str] = val
}
return val
})
Looks like the innards of the compiler are leaking out. Assigning a value to mem should error out with mem cannot be assigned a value. mem must be assigned a function.
Assigning a value to
mem
instead of a function ((define (example) (mem 0.5))
) gives this confusing and unhelpful output (which is not registered as an error):Looks like the innards of the compiler are leaking out. Assigning a value to mem should error out with
mem cannot be assigned a value. mem must be assigned a function.
Also, thanks for the fantastic book!