On 13/12/2010 21:08, Carl Mäsak (via RT) wrote:
# New Ticket Created by  "Carl Mäsak"
# Please include the string:  [perl #80694]
# in the subject line of all future correspondence about this issue.
#<URL: http://rt.perl.org/rt3/Ticket/Display.html?id=80694>


<masak>  rakudo: class A { method foo { 'abc' }; A.^add_method('bar',
A.^can('foo')); }; my $x= A.new(); say $x.bar(); say $x.bar()
<p6eval>  rakudo : OUTPUT«abc␤No candidates found to invoke for method
'foo' on object of type 'A'␤[...]
<masak>  <takadonet>  only works once :(
* masak submits rakudobug
<masak>  if jnthn were here, he'd say that this result isn't so
strange; becuase .^can gives the dispatcher to the 'foo' method(s).
He might even defend it as correct. After all, a dispatcher has state - what .^can returns is even spec'd as an iterator. If you don't want a dispatcher, use .^methods. Of course, then you can't expect deferral to work within the method fetched that way. :-)

/jnthn

Reply via email to