So how does the compiler communicate with the meta-object protocol to ask "how do I generate code to access this slot?" if it's not a function provided by the MOP?
Given the normal public access semantics, "$.foo, @.foo, %.foo, &.foo are just shorthands of self.foo with different contexts" and "$.foo(1,2,3); # calls self.foo under $ context", the sigil of the attribute doesn't show up when accessing it, so you can't have attributes with the same base name but different sigils.
Is the same thing true with $!foo, @!foo, etc? After all,
"$!think($pinky) # short for $(self!think($pinky))"
and I can't imagine the grammar doing things differently depending on whether the token after it was declared as a method or an attribute. I don't see the ! becoming twigil-like for attribute names, right?
So, does $!foo appear to have a similar nature to $!bar (one of those is an attribute and the other is a submethod; which is which?) with respect to @!foo etc meaning the same slot in a different context? Or does it appear to be similar to a local variable, with the sigil and twigil being part of the name and @!foo being a different location?
—John
In reply to Re^5: Language features affect style
by John M. Dlugosz
in thread Language features affect style
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |