On 8/8/05, David Nicol <[EMAIL PROTECTED]> wrote: > On 8/8/05, Nicholas Clark <[EMAIL PROTECTED]> wrote: > > On Wed, Aug 03, 2005 at 06:04:44PM -0700, Michael G Schwern wrote: > > > On Thu, Aug 04, 2005 at 12:26:32AM +0200, Abigail wrote: > > > > What would the gain be if you remove $[? > > > Taking it out would simplify the PMC(s) that replace AVs > > depending on the implementation details. In a scenario where a set $[ > causes adjustment to all AV lookups within its lexical scope, at compile time, > $[ could be implemented as a compile-time adjustment. All instances of > > $A[index_expression] > > become > > $A[(index_expression) - $[ ] > > during a compile-time step, and the PMC virtual table for the AV can always > have a base of 0, and the backwards-compatbility pragma to bring $[ back > can snag array indexing at compile time and insert its adjustment.
Actually, $] = 1; eval q/$foo[1]/ is supposed to return the first element of @foo. So you can't completely optimize it out at compile time.