Re: Custom errors on subsets?

2010-01-05 Thread Ovid
--- On Tue, 5/1/10, Jonathan Scott Duff perlpi...@gmail.com wrote: From: Jonathan Scott Duff perlpi...@gmail.com I'd imagine that the functionality will fall out of the ability  to have nice failures because surely something like the following works now: subset Filename of Str where { $_

Re: Custom errors on subsets?

2010-01-05 Thread Solomon Foster
On Tue, Jan 5, 2010 at 11:18 AM, Ovid publiustemp-perl6langua...@yahoo.com wrote: --- On Tue, 5/1/10, Jonathan Scott Duff perlpi...@gmail.com wrote: From: Jonathan Scott Duff perlpi...@gmail.com I'd imagine that the functionality will fall out of the ability  to have nice failures because

Re: Custom errors on subsets?

2010-01-05 Thread Ovid
--- On Tue, 5/1/10, Solomon Foster colo...@gmail.com wrote: From: Solomon Foster colo...@gmail.com Is this a bug or just documented behavior that I don't know about? fail just returns an uncalled exception.  What does that do in a where block? I knew it returned an uncalled exception,

Re: Custom errors on subsets?

2010-01-05 Thread Solomon Foster
On Tue, Jan 5, 2010 at 11:36 AM, Ovid publiustemp-perl6langua...@yahoo.com wrote: --- On Tue, 5/1/10, Solomon Foster colo...@gmail.com wrote: From: Solomon Foster colo...@gmail.com Is this a bug or just documented behavior that I don't know about? fail just returns an uncalled exception. 

Re: Custom errors on subsets?

2010-01-05 Thread Larry Wall
On Tue, Jan 05, 2010 at 11:52:42AM -0500, Solomon Foster wrote: : On Tue, Jan 5, 2010 at 11:36 AM, Ovid : publiustemp-perl6langua...@yahoo.com wrote: : --- On Tue, 5/1/10, Solomon Foster colo...@gmail.com wrote: : : From: Solomon Foster colo...@gmail.com : : Is this a bug or just documented

Re: Custom errors on subsets?

2010-01-05 Thread Jonathan Scott Duff
On Tue, Jan 5, 2010 at 1:07 AM, Ovid publiustemp-perl6langua...@yahoo.comwrote: --- On Mon, 4/1/10, yary not@gmail.com wrote: From: yary not@gmail.com How about multi sub foo(Any $name) { die Houston, we have a major malfunction.} Looks like tha would work, but it forces the

Re: Custom errors on subsets?

2010-01-05 Thread Jon Lang
Perhaps you could create an error function that temporarily sets the default error message (does perl 6 still have the $! variable?) and returns false; so: subset Filename of Str where { $_ ~~ :f or error ( No such file: '$_' ) } Of course, that's a rather narrowly-defined function, as it's

Re: Custom errors on subsets?

2010-01-05 Thread John Harrison
Would it make sense to have the failure bound to the function parameter rather than the subset? eg.: sub foo (Str $name where { $_ ~~ :f } else { die Houston, we don't have a file } ) { ... } Just a thought... On Tue, Jan 5, 2010 at 1:07 AM, Ovid publiustemp-perl6langua...@yahoo.comwrote: ---