develooper Front page | perl.perl5.porters | Postings from March 2001

Re: Distributive -> and indirect slices

Thread Previous | Thread Next
March 18, 2001 15:34
Re: Distributive -> and indirect slices
Message ID:
On Fri, Mar 16, 2001 at 09:52:01PM -0600, David M. Lloyd wrote:
> On 16 Mar 2001, Randal L. Schwartz wrote:
> > David> The first thing I'd like to do, is make the -> operator
> > David> 'distributive' for all cases of it (that I can think of
> > David> anyways).
> > 
> > The first thing you'd like to do is break the current definition of
> > the operator which already provides scalar context to its left side,
> > and has done so since its inception.  (See my current thread
> > in comp.lang.perl.misc.)
> > 
> > No, I don't think so.
> Ouch.  I guess I desrved that. :-)  I'll look up the thread.
> > Maybe for Perl6, but only with careful thought.
> My thinking was that not too many people use the current
> behaviour... maybe for Obfuscated Perl contests, but the operator could be
> so much more powerful than it is right now.

Eh, don't forget it also provides scalar context to 'method' in:

    $obj -> method -> other_method;

I don't think methods returning objects in scalar context and lists
in list context are obfuscated. That's what's wantarray is about, isn't?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About