Yes. That is a good example of the possible surprise factor.
Now inherit Class Qux from Class Bar, and every time you call ->foo() from any instance of either class, state $bar will be incremented. This has the potential for an even bigger surprise factor I think.
In reply to Re^4: How will you use state declared variables in Perl6?
by BrowserUk
in thread How will you use state declared variables in Perl6?
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |