source-academy/js-slang

CSE machine: function application in const as last statement

Closed this issue · 1 comments

This program fails to run in the CSE machine:

function goo() {
    const g = () => 1;
    return g;
}
const p = goo()();
//999; //uncomment for this to work in CSE

See https://share.sourceacademy.nus.edu.sg/90gak

This is somehow sufficient:

const a = (v => v)(0);
// const b = a; // uncomment for this to work