Carl Mäsak cmasak-at-gmail.com |Perl 6| wrote:
I have come to understand that this is an available possibility, yes.
That doesn't mean I like it. :)

My complaint could be pithily summarized as "those are _my_,
attributes, why can't I write to them?"

// Carl

If the accessor were implemented to do something more interesting than just assign to the private location, then having some code call the accessor and other code access the private location directly with the same syntax would be confusing.

For untyped variables, it would be difficult to determine whether something is a method call or an attribute on a type that I'm in the body of. Everything would have to be public methods, with a run-time check on the scope of the caller to see if it were allowed. Having a different syntax for private access simplifies things.

I'm wondering if the strange wording concerning
     has $x;
with no twigal is meant to take care of this case. But I don't understand what he meant in the Synopses, though I've asked about it repeatedly on this list and other places, so I largely ignore that case.

It says something about making $x available as an alias in the lexical scope. In context of what you are asking, maybe that's what it is for.

--John

Reply via email to