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 06:20
Subject:
Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->
Message ID:
AANLkTi=vejH9jXbMDn4a9r5aOyhCpu06zpq_sr+-o2sT@mail.gmail.com
On 29 November 2010 15:11, Abigail <abigail@abigail.be> wrote:
> On Mon, Nov 29, 2010 at 07:51:12AM -0500, David Golden wrote:
>> On Mon, Nov 29, 2010 at 5:53 AM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
>> > Wasn't the whole ?PAT? deprecation discussion not started because of
>> > the suggested -?> ?
>> >
>> > If & My preference goes to -&>
>> > Otherwise I like any form of the ? which reads for me in perfect sense
>> >
>> > ?->
>> > -?>
>> > ->?
>>
>> At the risk of opening a can of worms, could this syntax be enabled
>> via a feature (explicitly switching off bare ?PATTERN? support?  And
>> then in 5.16.0, it could become standard without needing the feature
>> if ?PATTERN? is then removed.
>>
>
>
> I prefer to have a solution that's currently a syntax error. Then:
>
>  - It's a clear compile error if someone tries to compile it pre-5.14.
>  - Doesn't need 'use feature' when running with 5.14.
>  - Code that has been developped for 5.16 which uses the new operator,
>   doesn't need additional changes if it's to be run on 5.14.
>
>
> Now, I don't think they are very strong arguments, but strong enough
> to not prefer any of '?->', '-?>', or '->?'.

I think ?-> is out just on the basis that it is a chord-key-chord
sequence on I think a lot of keyboard layouts. I would prefer that if
we have to have a double chord sequence that they are together. By
chord i mean any "key" that requires a shift to access. For me ?-> is
"shift slash, dash, shift dot", which is an annoying key-sequence to
want to do very often. -?> is at least, "dash, shift-and-hold, slash
dot" or "dash shift-slash, shift-dot".

So far ->> and ~> seem the nicest for my keyboard: "dash,
shift-and-hold slash, slash" or "shift-hashmark, shift-dot".

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