On Sat, Jul 31, 2010 at 10:56:47AM -0600, David Green wrote:
> It's not unreasonable, especially if that's what you expect.  
> But it's even more reasonable to expect this to work:
>       given $something { 
>               when True { say "That's the truth!" }
>               when 42 { say "Good answer!" }
>               when "viaduct" { say "You guessed the secret word!" }
>       }

I'm not so sure about this.  There's an argument to be made that
the C<when 42> and C<when "viaduct"> cases should never be reachable,
since both C<42> and C<"viaduct"> are considered "true" values...

... unless you want C<when True> to do a value-and-type check,
in which case it doesn't exactly follow the pattern for smartmatching
of the other builtin types (which only check value equivalence, 
not type equivalence).  

Pm

Reply via email to