On Tuesday 04 September 2001 10:10 pm, Dan Sugalski wrote:
> At 08:59 PM 9/4/2001 -0400, Bryan C. Warnock wrote:
> >Yes, this is akin to redeclaring every lexical variable every time you
> >introduce a new scope.   Not pretty, I know.  But if you want run-time
> >semantics with compile-time resolution....
>
> That is exactly what it is, alas. If we allow lexicals to get injected in,
> we need to either do this (Basically having every non-package variable
> getting an entry in the scope's pad) or search backward. I don't much like
> either option, but I think this is the best of the lot.
>
> So much for the "Extra braces don't carry any runtime penalty to speak of"
> speech in class... :)

Well, they still wouldn't.  Mostly.

All the pads could *still* be set up at compile time.  All lexicals within a 
scope would be grouped together, which might (doubtful) help reduce paging.
If pads were still arrays, the original construction would consist of  
memcopys - about as cheap of duplication that you'll get.  And the 
performance hits would be taken only by a) the unqualified globals, and b) 
the actual twiddling of the lexical variables (both in lookup, and in 
manipulation).  If you're going to take hits, that's where to take them.

Of course, then you've got the bloat to worry about.  Which might make your 
decision to go ahead and be slow an easy one....

But why are we on the language list for this?  Back to internals we go......

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to