On Mon, Jan 4, 2010 at 5:15 AM, Ovid
<publiustemp-perl6language2@yahoo.com> wrote:
> Given this code:
>
> subset Filename of Str where { $_ ~~ :f };
>
> sub foo (Filename $name) {
> say "Houston, we have a filename: $name";
> }
...
> Obviously the error message can use some work, but how would I customize that error message (assuming such will be possible in the future)? Clearly there will be many cases where a custom error message for constraint failure could make life much easier for developers.
How about
multi sub foo(Any $name) { die "Houston, we have a major malfunction."}
-y
Thread Previous
|
Thread Next