Hi there,
Assuming those two files A.pm and B.pm.
The file A.pm contains a class A and a role R with a private-method and
a $!private member. (the files are in the end of the e-mail)
1) I am wondering why a role can all its private methods:
> perl6 -I. -e 'use A; use B; my $b = B.new; $b.pu
The test in S14-roles/basic.t passes now on JVM.
Also the code from lizmat++ does not die:
$ perl6 -e 'role R { method !m(@a) { say "ok: @a[]" }; method x() { self!m((my
%).values) } }; class C does R { }; C.x'
ok:
I haven't yet looked at src/core/IO/Local.pm or src/core/Temporal.pm
This works on Moar but fails on Parrot and JVM:
$ perl6-m -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI"
} }; class C does A { }; C.new.pub;'
OH HAI
$ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI"
} }; class C does A { }; C.new.pub;'
Cannot
s: looks like 'self' isn't parameterized correctly in
private methods in roles.
r: class A { method pub { self!priv }; method !priv { say "OH
HAI" } }; A.new.pub
rakudo-parrot a77214, rakudo-jvm a77214: OUTPUT«OH HAI»
skids: do you know if that's already submitted?
masak
Em Qua, 2009-07-08 às 12:49 -0700, Ovid escreveu:
> Behavioral: if you are primarily relying on roles to provide behavior
> (as we do at the BBC), then silently discarding the role's behavior by
> providing a method of the same name in your class can lead to very
> confusing bugs. I've lost a lot