You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we want to avoid extra destructuring (car_cdr()), which incurs hashing costs in the circuit, the check should not come at the time of creating the function, but later (probably when handling Continuation::Call2 in apply_continuation().), when the body is being inspected.
The text was updated successfully, but these errors were encountered:
@porcuquine I tried implementing it the way you specified, but I find it strange that you are allowed to create a lambda with an invalid body, but you can't call it - was that your intention?
Lurk REPL welcomes you.
> (lambda () 1 2 3)
[1 iterations] => <FUNCTION () 1>
> ((lambda () 1 2 3))
Evaluation error: Function body must be only one element
>
Having completed the cons hashing optimizations, I now suspect we can afford to perform the destructuring earlier — so you can go ahead and change it as you suggest. We'll want to ensure that works without adding a hash to the circuit though.
As noted in a comment on #183, we currently allow
lambda
forms that don't have exactly one body element. It would be better if this led to an error.Examples:
Since we want to avoid extra destructuring (
car_cdr()
), which incurs hashing costs in the circuit, the check should not come at the time of creating the function, but later (probably when handlingContinuation::Call2
inapply_continuation()
.), when the body is being inspected.The text was updated successfully, but these errors were encountered: