On Wed, Oct 07, 2015 at 07:07:53PM +0200, Lukas Mai wrote: > Am 07.10.2015 um 10:24 schrieb Dave Mitchell: > > > >What I think we should do: > > > >1. Get rid of the ~~ operator altogether, plus '~~' overloading. > > > >2. Make when's behaviour entirely dependent on the *compile-time* class > >of of its arg. In particular, make 'when (FOO)' have exactly the following > >behaviours: > > > > FOO condition evaluates to > > -------------- ---------------------- > > literal undef !defined($_) > > numeric const $_ == FOO > > literal pattern $_ ~= FOO > > all else $_ eq FOO > > > >3. when { FOO } has condition FOO. > > (You typo'd =~ as ~= above) Oh yeah :-( > This would mean 'when (qr/.../)' becomes 'when { $_ eq qr/.../ }'. Good point. So a literal qr// will have to be accepted as well as a literal //, perhaps along with a warning that "given(qr/.../) better written as given(/.../)" ? -- A walk of a thousand miles begins with a single step... then continues for another 1,999,999 or so.Thread Previous | Thread Next