On Thu, 2002-04-11 at 00:42, Luke Palmer wrote:
> > Ah, but I think the mnemonic value of the '.' more than earns its keep
> > here. C<our $foo is private> is doing a slightly different job
> > anyway. And instance variables are *not* the same as 'normal'
> > variables, they hang off a different symbol table (or syte, to use
> > Damian's oh so clever term from Perl 5+i) and I'm all for things that
> > are different *looking* different.
> > 
> 
> Well, I certainly don't like the aesthetic value of them. They are ugly 
> as Perl 4. But, I have been caught in C++ making all my private variables 
> _named _like _this, so I suppose it's analogous. But I don't like being 
> forced to do it that way.
> 
> What if you just want a simple struct-like thing? That's when it becomes 
> really ugly and dislikable. Erm... wait a minute, how would you do that?
> 
> $foo = new Foo;
> $foo..instancevar = 7;
> I doubt that's it.
> 
> $foo.instancevar = 7;

This should not be allowed. External code should not access instance
variables. We did discuss the idea that accessors would be created
automatically, and coincidentally, you're using the correct syntax for
that above, but certainly there should be the ability to override the
default accessor and to declare an instance variable as accessor-less.

In Perl5 C<$object{instancevar} = 7> is just frowned on. In Perl6, I
thought we had agreed that it would flat out be impossible.


Reply via email to