Re:Adventures of an imperative programmer in the land of fp
by jules on Friday August 27, 2010 @07:11PM
(#1640597)
Yes, that's actually close to another way of implementing it. But you can't just blindly assign the scope of baz to foo and bar, because foo and bar might have local variables of their own. Another issue is that baz might have local variables that aren't used in foo and bar, so when baz returns you want the garbage collector to be able to reclaim that storage (otherwise it could lead to arbitrary space leakage if these variables point to large structures). You need a tree structure of environments in the general case.
[ Parent
| on HN ]
There are no comments on this comment yet.