r29454 - docs/Perl6/Spec

2010-01-04 Thread pugs-commits
Author: moritz Date: 2010-01-04 11:49:21 +0100 (Mon, 04 Jan 2010) New Revision: 29454 Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] small clarification for .match and .subst Modified: docs/Perl6/Spec/S05-regex.pod === ---

Re: String to Regex

2010-01-04 Thread Jan Ingvoldstad
On Sun, Jan 3, 2010 at 8:30 PM, Moritz Lenz mor...@faui2k3.org wrote: But since $input can contain closures, arbitrary code can be executed. I'd like to propose a way to compile a string to a regex which doesn't allow code execution. So would I. I would also like it to be the default

Custom errors on subsets?

2010-01-04 Thread Ovid
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,

Re: Custom errors on subsets?

2010-01-04 Thread yary
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

Re: Custom errors on subsets?

2010-01-04 Thread Ovid
--- 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