develooper Front page | perl.perl5.porters | Postings from March 2011

RE: Revising Perl's OO docs - a new OO tutorial

Thread Previous | Thread Next
From:
Jan Dubois
Date:
March 8, 2011 08:22
Subject:
RE: Revising Perl's OO docs - a new OO tutorial
Message ID:
005701cbddad$07c7b3c0$17571b40$@activestate.com
On Mon, 07 Mar 2011, Abigail wrote:
> I would go the other way. The fact that calling a method is implemented
> as storing/fetching a value is an implementation detail that should not
> be exposed to the user. Hence, it should not have a different syntax.

In that case I don't understand why you ever use tie() instead of
calling your FETCH and STORE functions directly? It is exactly the same
kind of syntactic sugar as attributes/properties on objects:

* Tied variables look like variables but are implemented as function calls.
* Properties look like fields but are implemented as method calls.

Cheers,
-Jan


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About