Hmmmm. In light of my arguments in defending bidrirctional overloading, and of chromatic's observation regarding the relative ease of various types of inversion-of-control on error reporting, I'm now convinced the proposal should be: ______________________________________________________________________ Smartmatch (~~) table ===================== $a $b Meaning ===== =================== ======================== Any ~~-overloaded [1] $b->ol_method($a, 'rev') ~~-ol Any [1] $a->ol_method($b) Any undef ! defined $a Any CodeRef, &{}-ol $b->($a) Any Regexp, qr-ol $a =~ $b Any unambiguous Num [2] $a == $b Any unambiguous Str [3] $a eq $b Any Any undef (with fatalizable warning) [1] Includes junctions, whose overloading distributes the smartmatch over their elements in their several ways. [2] If $b has an internal numeric representation but no internal string representation (or if some putative internal flag assures us it was originally a number). [3] If $b has an internal string representation but no internal numeric representation (or if some theoretical inner flag promises us it was initially a string). The when construct ================== Form Meaning ================== ================================== when (EXPR) {...} if ($_ ~~ (EXPR)) {...; break} when {BLOCK} {...} if ($_ ~~ sub{BLOCK}) {...; break} No exceptions. No special cases. ______________________________________________________________________ DamianThread Previous | Thread Next