develooper Front page | perl.module-authors | Postings from November 2003

Re: Class::FakeAttributes -- Opinions Wanted

Thread Previous | Thread Next
A. Pagaltzis
November 6, 2003 09:06
Re: Class::FakeAttributes -- Opinions Wanted
Message ID:
* <> [2003-11-04 12:30]:
> use My::OutOfBandLexicalThing qw( Attr Attr2 Attr3 );
> and you'd get lexically scoped, overload worry free, out of
> band attrs without any bothersome typing.

* A. Pagaltzis <> [2003-11-06 18:00]:
> I'm not interested in where the attribute is stored. I'm
> talking about the attribute. Whether it is accessed by hash
> lookup or closure call makes no difference. In Yves' code, the
> attribute is only accessible to the method in its scope (by
> looking it up in the lexically scoped hash), while using your
> code, the attribute would be accessible globally (by calling
> the exported function).

Of course, my point is only valid for cases where it is not
desired for the "naked" attribute to be accessible, but rather
that the accessor be able to present a computed value f.ex from
several compound private attributes, or a mutator be able to set
computed values or even just to verify values before setting

In that case, you have to implement the insideout-ness yourself
as per Yves' code, rather than using your method maker.

"If you can't laugh at yourself, you don't take life seriously enough."

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About