Re: Mutable Bytes
"Mark Hahn" <[email protected]> Mon, 26 Jul 2004 22:52:06 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Greg Ewing wrote: > Mark Hahn <[email protected]>: > >> Even before I decided to store the local vars in the function >> attributes, > > Local vars belong in a stack-frame object or equivalent that's created > per function call. Copying the function itself for this purpose seems > like needlessly mixing up concepts that should be kept separate. Yes, you're right. I mistakenly thought it was already being copied or I would never have dreamed up such a goofy idea. It would have functioned ok. A shallow copy of a function is only a few more words than a scope object. There is already a link to the function in each stack frame. This would have just been a unique copy of the function instead of a shared copy. The big problem would have been the shadowing of function (static) vars.