Larry Wall <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 19, 2005 at 02:02:41PM +0000, Ingo Blechschmidt wrote:

>:     # Possibility #2
>:     multi sub *postcircumfix:<'[', ']'>(TiedArray $self, $index) {
>:       # Body as above
>:     }

> None of those are quite right, because you have to be prepared to deal
> not only with slices, but with multiple dimensions of slices.

Then again the question arises, if all the possible indexed access isn't
clearer written as multi subs:

  multi sub *postcircumfix:<[ ]>(TiedArray $self, int $index) {...}
  multi sub *postcircumfix:<[ ]>(TiedArray $self, Int $index) {...}
  multi sub *postcircumfix:<[ ]>(TiedArray $self, Slice $index) {...}
  multi sub *postcircumfix:<[ ]>(TiedArray $self, MyDims $index) {...}

or with FETCH and STORE as distinct variants too, and r/w ...

> That's the philosophy, anyway.  It may yet turn out that proxying
> completely fouls up the optimizer in this case.  Sometimes a
> cut-and-paste has the benefit of being concrete enough for the
> optimizer to understand, whereas the abstraction is too, er, abstract.

Yep.

> ...  However, that being
> said, there's enough flexibility in the FETCH/STORE proxy that you
> could "defactor" the identification code out to the various handlers
> and get the same benefit.

Well, isn't the "defactorized" code just a bunch of multi subs?

> Larry

leo

Reply via email to