Smatchmatch against Pair not smart enough?
Currently S03 says about smartmatching against pairs:
Any Pair test object attribute ?."{X.key}" === ?X.value (e.g. filetests)
The primary value of this is for things like $file-path ~~ :e, which tests for the existence of a file, and $file-path ~~ :!e, which tests for the non-existence of a file.
It seems strange that Perl 6 forces a boolean comparison to the value. Wouldn't it be more consistent for the rule to be:
Any Pair test object attribute ."{X.key}"() ~~ X.value
IRC conversation here: http://irclog.perlgeek.de/perl6/2014-04-27#i_8644524
Note that $anything ~~ True is True, so your proposal would imply :!e ~~ :e, which isn't very intuitive. On the flip side, $anything ~ False is false, so $anything ~~ :!e would always return False.
IMHO the right thing to do is to abolish the ~~ :e notation for file testing; methods work well enough.