On Thu, 2002-04-11 at 11:49, Larry Wall wrote:
> Aaron Sherman writes:

> : This should not be allowed.
> 
> Well, that depends on what you mean by "this".  :-)
[...]
> : In Perl5 C<$object{instancevar} = 7> is just frowned on. In Perl6, I
> : thought we had agreed that it would flat out be impossible.
> 
> Who agreed to that?  First of all, it's perfectly possible that (for a
> non-hash) that syntax is isomorphic to
> 
>     $object.instancevar = 7;

We're in violent agreement ;)

What I was saying was that C<$.x> ne C<$obj.x>. One is directly
accessing an instance variable and one is an accessor (which may in fact
be optimized by the compiler in some cases, but the control still lies
in the hands of the class author). Further, I was refering to a previous
thread (no ref handy) where it was stated that instance variables would
be private and accessors would be created automatically (which you
reiterate and clarify in your response here).

I agree that there may be code that looks an awful lot like hash access,
and in practice some of those usages may even BE simple hash access
after compiler optimization. The key difference is that that is all
under the control of the class author (or rather the class author has
the right/ability to give up control). When the author wishes for
something that looks like instance variable access to become a remote
procedure call or have some taint checking performed, this too should be
their choice (and hopefully would not have to involve any C<tie>ing or
the like, but would instead fall neatly out of the way accessors work).

I think you have agreed with the above, but I was stating it too quicky
in my original post, and it came out like a statement that the syntax of
instance variable access would never be allowed again, when I was only
refering to the semantic.


Reply via email to