Re: Dynamic method generation?

2011-01-08 Thread Sean McAfee
On Sat, Jan 8, 2011 at 3:50 PM, Moritz Lenz wrote: > class MyMatcher { >for -> $field { >MyMatcher.^add_method($field, method() { > self!matches($field); >} >); >} > } > > The .^ means a method of the metaclass is called, here add_method > > M

Re: Dynamic method generation?

2011-01-08 Thread Moritz Lenz
On 01/08/2011 09:11 PM, Sean McAfee wrote: > package MyMatcher; > > my @SIMPLE_FIELDS = qw(FOO BAR BAZ BLETCH QUUX ...); > > for my $field (@SIMPLE_FIELDS) { > no strict 'refs'; > *{ "is_\L$field" } = sub { shift->_matches($field) }; > } > class MyMatcher { for -> $field {

[perl #81982] [BUG] Infinite recursion where none was expected after rebinding &return in Rakudo

2011-01-08 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #81982] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=81982 > rakudo: my &r = &return; sub f { &return := -> $v { say "LOL!"; &r($v) }; return(42) };

[perl #81974] [BUG] LTA error message when something isn't a number in a sequence operator in Rakudo

2011-01-08 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #81974] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=81974 > rakudo: (0, {last if $^a==$^b; (1..5).pick} ... *).perl.say rakudo e7e9d5: OUTPUT«Meth

Dynamic method generation?

2011-01-08 Thread Sean McAfee
Hello-- I recently wrote some Perl 5 code similar to the following, and I'm wondering what might be the analogous construction in Perl 6: package MyMatcher; my @SIMPLE_FIELDS = qw(FOO BAR BAZ BLETCH QUUX ...); for my $field (@SIMPLE_FIELDS) { no strict 'refs'; *{ "is_\L$field" } = sub {

Re: Shootout Benchmarks

2011-01-08 Thread Guy Hulbert
On Sat, 2011-08-01 at 09:44 -0800, Isaac Gouy wrote: > > I will try to see if there's any more sane way to do this > > > http://alioth.debian.org/scm/viewvc.php/shootout/bench/?root=shootout Thank you very much. Trying CVS was on my list of things to do but that will save me some time (and it w

The new (proposed) module infrastructure

2011-01-08 Thread Tadeusz Sośnierz
Hello, Inspired by reading S22 draft, I started building some new module infrastructure for the Perl 6 ecosystem, described briefly in [1]. To cut the long story short, it allows to easily collect the metadata of all the modules in the ecosystem, like versions, dependencies etc without neceserilly