Ricardo Signes wrote: > # STEP TWO > $obj ~~ $x --> uses ~~ overloading if present, otherwise pass ... >The change here is "Step Two." I'm not particularly a fan of it, and would >discourage it, but it has the practical benefit of keeping autodie working. If this goes into blead, then this is the part that in years to come we will look back on and ask "what were we thinking?". Better to make autodie handle the cleaner behaviour, if necessary with version-dependent code paths. > I am surprised that the result of the subroutine is returned > # as the result of the smart match ?????that is, that it is not forced into > # a boolean. I think I'm going to mark that up as my problem, not perl's, > # but I'm still surprised. -- rjbs, 2015-09-09 This sounds rather like some recently-discussed features in the tied hash system. IIRC, someone wanted exists($h{$k}) to return whatever the EXISTS method returns, whereas it actually returns a canonical-form truth value. The consensus there was that the concept of the exists operator is fundamentally a predicate operation, and it's not meaningful for it to return any information beyond a mere truth value. Hence the canonicalisation is a good thing. Smartmatch is also fundamentally a predicate operation, and by the same logic should also canonicalise its return value. Likewise, if it doesn't already, it should always call a sub or overloaded method in scalar context. -zeframThread Previous | Thread Next