Re: Outers, fields and locals
Mark Miller <[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Mar 8, 2010 at 5:55 AM, Darius Bacon <[email protected]> wrote: > Thomas Leonard <[email protected]> wrote: >> EvalContext holds three arrays: >> >> private final Object[] myLocals; >> private final Object[] myFields; >> private final Slot[] myOuters; >> >> What's the difference between these? My current guess is: >> >> - locals is a new set of bindings created each time you invoke a >> method and includes the local variables and the method's arguments. >> - fields are the values that were in scope when the object was defined >> and which are used in the object and which aren't in safeScope. >> - outers is everything else. > > Almost. IIRC, outers are module-level and top-level variables. This > reduces the amount of copying needed to create a closure; if we had > only myLocals and myFields, then myFields would usually be much > larger. The outers arrays can be shared, one per module. > > (It's been most of a decade since I dealt with this code; you should > get someone who still knows it better.) Hi Darius, your memory remains correct. That's why. > > Darius > _______________________________________________ > e-lang mailing list > [email protected] > http://www.eros-os.org/mailman/listinfo/e-lang > -- Text by me above is hereby placed in the public domain Cheers, --MarkM