develooper Front page | perl.perl5.porters | Postings from November 2010

Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->

Thread Previous | Thread Next
From:
Abigail
Date:
November 29, 2010 13:16
Subject:
Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->
Message ID:
20101129211744.GD18489@almanda
On Mon, Nov 29, 2010 at 04:03:02PM -0500, Jesse Vincent wrote:
> 
> 
> 
> On Mon 29.Nov'10 at 21:47:57 +0100, Abigail wrote:
> > On Mon, Nov 29, 2010 at 01:54:10PM -0500, Jesse Vincent wrote:
> > 
> > blunt. My votes go for, in that order:
> > 
> >     ->>
> 
> To me, this doesn't have any mnemonic value.

It's a special arrow. ;-)

But no, it doesn't have any mnemonic value to me. But then, ->? doesn't
have any mnemonic value to me (if it did, it would remind me of something
different) either. The only proposal that has a little mnemonic value
to me is &&->, and that's only due to the association of && with short
circuiting.

To me, ->> looks like an arrow. ->? doesn't.

> >     ==>
> >     -=>
> 
> I can't imagine how much pain we'd experience explaining to newbies that
> => is a comma, except when it's longer, in which case it's actually a
> conditional dereference. 


In the same way we explain that > is a comparison, except when it's
longer, and then it's a shift? Or = being assignment, except when
it's longer and it's a comparison operator? Or that - is unary minus,
except when it's subtraction, and when it's longer it's either pre- or
post decrement? Or that the reverse meaning of <= isn't => ?

I'm not really too worried about operators being substrings of other
operators; we already have them.



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