On Thu, Jun 25, 2009 at 1:20 PM, Moritz Lenz wrote:
> Hi,
>
> I had the pleasure to implement the series operator (&infix:<...>) in
> Rakudo(*), and came across the difficulty to come up with a signature
> for it. These are the use cases I want to cover:
>
> 1, 2 ... { $^a + $^b }
> 1 ... { $_ + 1
Hi,
I had the pleasure to implement the series operator (&infix:<...>) in
Rakudo(*), and came across the difficulty to come up with a signature
for it. These are the use cases I want to cover:
1, 2 ... { $^a + $^b }
1 ... { $_ + 1 }
The first one can clearly be written as
sub infix:<...>(@value
As I understand it, in Perl 6 a method of a class, as indeed all
similar things like a sub or a regex, is represented by an object. If
it's an object, I should be able to mix a role into it, right?
Something like:
role Fancy {
has $.something is rw;
}
sub a { }
&a does Fancy;
&a.something = 5