develooper Front page | perl.perl5.porters | Postings from July 2021

Re: Elevator pitch, deprecating $a/$b sort globals by using sub{}

Thread Previous | Thread Next
From:
Martijn Lievaart
Date:
July 5, 2021 20:57
Subject:
Re: Elevator pitch, deprecating $a/$b sort globals by using sub{}
Message ID:
d1974a18-58c8-32a4-9d5c-c2da138d2a02@rtij.nl
Op 04-07-2021 om 19:02 schreef Nicholas Clark:

[snip]

> I *think* that your new suggestion is only "not currently valid syntax"
> because you omit the comma. If I write:
>
> $ ./perl -Ilib -lwe 'use feature "signatures"; print for sort sub ($q, $r) { 1/$q <=> 1/$r }, (.5, .25, 3, 42, 1, -1, -.1)'
>
> The signatures feature is experimental at -e line 1.
> -0.1
> -1
> 0.25
> 0.5
> 1
> 3
> 42
> CODE(0x55c991505c68)
>
>
> at which point, it looks like this plan only works because a comma isn't
> there.
>
> Put a comma in, and the code means something else.
>
> That feels like a risky design.


That certainly seems like a very good argument against it. Not that the 
others are bad arguments, but this is certainly a (the?) nail in the coffin.

M4



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