You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure whether the assertion in that whole section is true. The error is precisely because the explicitly defined WHY method is being called in the SET_LEADING_DOCS method which in turn expects the WHY to return a Pod::Block::Declarator object (which has the _add_leading method.)
I would say that it's remove the assertion about the quotes and the example completely. Unless anyone feels it is a bug that the behaviour doesn't match the doc of course.
The example will run if it is rewritten so that the over-ride WHY returns the right kind of this:
#| THIS IS A CLASS FOR SHOUTING THINGSclassMY-CLASSES-ARE-ALL-CAPS {
multimethodWHY { Pod::Block::Declarator.new(leading => ["I DON'T KNOW"]) }
}
my$c= MY-CLASSES-ARE-ALL-CAPS.new;
say$c.WHY;
say$c."WHY"();
However it doesn't do what the text says because the over-ridden version will always get called.
I think that it definitely is remove the last sentence of the text and the example. Unless anyone chimes in quickly I'll just do it.
I received an error message, when I ran the following example code.
(From https://docs.perl6.org/language/mop#Metamethods)
However, I'm not sure what the better one is.
The text was updated successfully, but these errors were encountered: