On Thu, Jun 07, 2001 at 08:15:46AM +0100, Simon Cozens wrote:
> On Wed, Jun 06, 2001 at 07:21:29PM -0500, David L. Nicol wrote:
> > Damian Conway wrote:
> > >         $ref.{a}        can be          $ref{a}
> > which can also be
> >     $ref.a
> 
> Dereferencing a hashref is the same as accessing a property?

IIRC there was some suggestion of a class being able to declare
elements to be accessable as methods in this was.

So if $ref is of a known type and 'a' was declared in that way,
the parser would take $ref.a and turn it into $ref.{a}

This would have the benefit of not loosing encapsulation and
also the performance of not having to call a method which would
just look like

  sub a(Foo $self) :lvalue { $self->{a} }

(Did I get that syntax right ? probably not :)

Graham.

Reply via email to