Ricardo Signes wrote: >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, It totally could, without any real difficulty. XS code that knows specifically about the objects returned by num() could hook checking of the smartmatch op, recognise a num()-generated const value on the rhs, and replace the smartmatch with a numeric comparison op. Also, num() call expressions with const parameter expression can be constant-folded. Putting them together, "when(num(3))" would compile to the same ops as "when { $_ == 3 }". -zeframThread Previous | Thread Next