On Mon, Sep 21, 2015 at 3:36 PM, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote: > > This whole subthread is rebuilding my resolve. Plain scalars should go > pound > sand. I don't believe I'll see a way to use them on the rhs of ~~ that > will be > straightforward. > > I think we're better off with helpers to build tests, like Smart::Match. > > sub smartgrep ($test, @items) { return grep { $_ ~~ $test } @items; } > > If we want the test to be numeric, we can call: > > smartgrep num(4), @input; > > Making that faster than 0+@input subroutine calls should be possible in > the > future if someone decides it's worth doing. > > Meanwhile, we have: > > when { $_ == 1 } { ... } > > ...which is still shorter than: > > if ($_ == 1) { ...; break; } > > Also, if we disallow "when (5)" now, it can be enabled later, but if we > allow > it now, we're stuck with it. > > That was the plan when I first posted to this thread, and I don't know why > I > got distracted by this idea that I'd already dismissed ages ago. > The question then is, how do we deal with backwards compatibility? LeonThread Previous | Thread Next