Talk:First class environments: Difference between revisions

no edit summary
No edit summary
Line 4:
::: 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)
:::: If that's the case -- if this is a dictionary or whatever -- perhaps the task ought to have something about dynamically generated names? --[[User:Rdm|Rdm]] 21:28, 30 June 2011 (UTC)
::::: A dictionary encapsulates keys and values (must be explicitly accessed/fetched), but not variables and their values (transparently changing the behavior of the code).--[[User:Abu|Abu]] 06:00, 1 July 2011 (UTC)
::: No, nothing to do with objects. Objects encapsulate code and data. Environments encapsulate variables and their values (closures minus code).--[[User:Abu|Abu]] 06:00, 1 July 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