2 ms·
> Is it literally just the language invisibly adding the parent-scope variables and their values to the top of my function? Yup. A "first class" closure is jus
by zozbot234 7y ago
> Is it literally just the language invisibly adding the parent-scope variables and their values to the top of my function?
Yup. A "first class" closure is just reifying some arguments of a future function call and bundling them up nicely in a struct/record. This is especially clear in languages that support currying, since that means you'll literally be building that record step-by-step - only after a full set of arguments is provided does a true function call really occur.