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

Re: Distributive -> and indirect slices

Thread Previous | Thread Next
From:
abigail
Date:
March 18, 2001 15:34
Subject:
Re: Distributive -> and indirect slices
Message ID:
20010318233744.917.qmail@foad.org
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?



Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About