String to Regex

2010-01-04 Thread Moritz Lenz
Some Perl 5 programs take a regex (in string form) as input, and simply interpolate it into a regex. In Perl 6, you'd do that as my $re = rx/ <$input> /; 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

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 === --- doc

Re: String to Regex

2010-01-04 Thread Jan Ingvoldstad
On Sun, Jan 3, 2010 at 8:30 PM, Moritz Lenz 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 behaviour, since th

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 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

[perl #71810] [BUG] multiple declared subs

2010-01-04 Thread na...@khemir.net (via RT)
# New Ticket Created by na...@khemir.net # Please include the string: [perl #71810] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71810 > rakudo commit: db84bc06990c37b93fe987dcffab4ed9bf31de92 build/PARROT_REVISION: 43076

[perl #71814] [BUG] no information about where the error occured in Rakudo

2010-01-04 Thread na...@khemir.net (via RT)
# New Ticket Created by na...@khemir.net # Please include the string: [perl #71814] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71814 > rakudo commit: db84bc06990c37b93fe987dcffab4ed9bf31de92 build/PARROT_REVISION: 43076

[perl #71812] [BUG] =pod has no effect

2010-01-04 Thread na...@khemir.net (via RT)
# New Ticket Created by na...@khemir.net # Please include the string: [perl #71812] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71812 > rakudo commit: db84bc06990c37b93fe987dcffab4ed9bf31de92 build/PARROT_REVISION: 43076

[perl #71808] [+] @a should be equivalent to reduce &infix:<+>,@a

2010-01-04 Thread na...@khemir.net (via RT)
# New Ticket Created by na...@khemir.net # Please include the string: [perl #71808] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71808 > rakudo commit: db84bc06990c37b93fe987dcffab4ed9bf31de92 build/PARROT_REVISION: 43076

[perl #71816] [BUG] no information about where in the source code the error occures

2010-01-04 Thread na...@khemir.net (via RT)
# New Ticket Created by na...@khemir.net # Please include the string: [perl #71816] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71816 > rakudo commit: db84bc06990c37b93fe987dcffab4ed9bf31de92 build/PARROT_REVISION: 43076

[perl #71820] Subset name omitted from error when typecheck fails

2010-01-04 Thread publiustemp-perl6interna...@yahoo.com (via RT)
# New Ticket Created by publiustemp-perl6interna...@yahoo.com # Please include the string: [perl #71820] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71820 > For this code: use v6; class Foo { subset Filename

Re: Custom errors on subsets?

2010-01-04 Thread Ovid
--- On Mon, 4/1/10, yary wrote: > From: yary > 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 failure, if they forget, we'r