Talk:First class environments: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2:
:No, because a closure cannot be handled independently from the code, e.g. stored in a variable and activated at some other time with a piece of code.--[[User:Abu|Abu]] 09:19, 30 June 2011 (UTC)
:: This looks like what most people would call an "object". Since we already have examples of objects, I am not sure how this task is interesting. --[[User:Rdm|Rdm]] 20:56, 30 June 2011 (UTC)
::: I guess it's more about directly rebinding variable names than accessing objects; in the PicoLisp example the job funtions accessed N as if it were the only instance out there. The C cheat code is more of an object, though. --[[User:Ledrug|Ledrug]] 21:22, 30 June 2011 (UTC)
 
Concerning the question whether the C solution "fits the spirit": I would say yes, though instead of switching the pointers to 'sec' and 'cnt' I would save and restore the actual values. This would better simulate the "binding" of the "environments".--[[User:Abu|Abu]] 15:17, 30 June 2011 (UTC)
Anonymous user