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

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

Thread Previous | Thread Next
From:
demerphq
Date:
November 29, 2010 12:38
Subject:
Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->
Message ID:
AANLkTikPLTu1rOBnJncS62VAvy9qJKZFS8WzJteryG=6@mail.gmail.com
On 29 November 2010 21:27, Zefram <zefram@fysh.org> wrote:
> Jesse Vincent wrote:
>>Why _shouldn't_ we bless ->? as the correct syntax for "defined/safe
>>dereference"?
>
> Because it doesn't at all match Perl 6's ".?".  Our operator
> is conditional on defined($lhs), but Perl 6's is conditional on
> $lhs->can("rhs").  These are very different semantics.
>
> Apart from wanting to match Perl 6, having the "?" come at the end of
> the arrow suggests that the conditionality is focussed on the RHS (which
> it is with Perl 6's operator).  The condition we're actually concerned
> with is purely about the LHS, so if the extra character to signal it is
> not going to be in the middle of the arrow then it should come first.
> I'd be mostly OK with "?->", I just find it visually breaks up awkwardly.

I really hope that -?> is chosen instead of ?->, which I already
*hate* typing. (chord-key-chord is no fun unless you are a pianist -
which I am not).

cheers,
Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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