* Abigail <abigail@abigail.be> [2015-10-12T20:08:20] > Bike-shedding: > > when:def {...} # !defined $_ > when:num (3) {...} # $_ == 3 > when:str ("foo") {...} # $_ eq "foo" > when:pat (/bar/) {...} # /bar/ compare: when (num(3)) { ... } when (str("foo")) { ... } This gets you the same behavior, but leaves the test value as a thing that can be used as the rhs of a match, which means it can be passed around as a first class predicate value. The downside is that given a currently possible implementation of &num, it would do a lot more work than being compiled down to an == operation in the op tree. On the other hand, a future &num could provide a faster magic value that ~~'s implementation can know to directly resolve to a numeric comparison. I'd doubt it would ever match custom when:num syntax in speed, but I think it is much more generically useful because it enables tests to be arguments rather than only in-place parts of the program source. -- rjbsThread Previous | Thread Next