develooper Front page | perl.perl5.porters | Postings from September 2016

Re: pounding the smartmatch drum

Thread Previous | Thread Next
Father Chrysostomos
September 8, 2016 02:36
Re: pounding the smartmatch drum
Message ID:
Aristotle wrote:
> * Sawyer X <> [2016-09-06 17:24]:
. > Does anyone object to removing LHS overloading?
> I do.
> Without LHS overloading the given($@) API in autodie is unimplementable.
> :-(

I see no explicit smartmatch in the examples in the autodie documenta-
tion.  Maybe that is our way out: to make a distinction between 'when'
and '~~' overloading.

'when' will respect 'when' overloading on $_, and it will take prece-
dence over '~~' overloading on its argument.

~~ will only respect overloading on its rhs.

The thing that derailed the smartmatch revamp the last time around was
the fact that 'break' is inconsistent in its behaviour and the previ-
ous pumpking, whose ideas on how to fix it differed from mine, never
fully clarified what his ideas were, despite my questions.

I would like to see 'break' made equivalent to 'next', and to see
'given' respond to loop controls like the two other topicalizers.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About