On Wed, Nov 30, 2005 at 03:58:28PM -0800, Jonathan Sillito wrote: > On 11/30/05, Chip Salzenberg <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 30, 2005 at 12:02:08PM -0800, Jonathan Sillito wrote: > > > 2. Should we provide a way for a compiler to provide depths to the > > > find_lex and store_lex ops if it chooses to? > > > > Maximum depths, you mean? I know of no use case for it. > > Not maximum depth but the exact depth for a given lexical variable in > the case of closures.
Ah. Well, there is already supposed to be a variant on find_lex that takes a starting depth, and in the closure-efficiency case the starting depth will always be the final depth, so that use case is taken care of (or will be, once two-arg find_lex is available). > > > 5. Thinking about closure support vs. outer support - the difference > > > and the need for both mechanisms is not clear to me. > > > > Could you unpack this, please? > > Well, using :outer allows the look up algorithm to walk through > enclosing lexical scopes ($sub = $sub.outer). In the case of closures > the LexEnv is populated with the enclosing LexPads which I assume come > from enclosing lexical scopes, which allows the the look up to do the > same thing, no? I must be missing something here. What you're missing is that without the :outer information, Parrot wouldn't be able to decide *which* LexPads *should* be searched, either now (find_lex w/o LexEnv) or later (newclosure -> LexEnv). -- Chip Salzenberg <[EMAIL PROTECTED]>