--- 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 { $_
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
--- 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,
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.
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
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
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
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:
---
Given this code:
subset Filename of Str where { $_ ~~ :f };
sub foo (Filename $name) {
say Houston, we have a filename: $name;
}
my Filename $foo = $*EXECUTABLE_NAME;
foo($foo);
foo($*EXECUTABLE_NAME);
foo('no_such_file');
We get this output:
Houston,
On Mon, Jan 4, 2010 at 5:15 AM, Ovid
publiustemp-perl6langua...@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
--- 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 developer to remember to write
this extra code every time they may have a constraint
11 matches
Mail list logo