[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: On Pseudohashes
Tom Christiansen <tchrist@chthon.perl.com> writes:
>
> * Compile-time detection of the validity of $obj->attribute()
> in addition to just $obj->{"attribute"}. In the general case,
> this lies somewhere between hard and impossible.
How so? In both cases you have to "know" what class $obj is/can be.
my Dog $spot;
Gives as much or as little information to either.
$spot->{'tail_colour'}
or
$spot->bark;
You either look in $Dog::FIELDS{'name'} or CV of $Dog::{'name'}
(Perhaps %FIELDs should have been part of the stash ...)
--
Nick Ing-Simmons
- References to:
-
Tom Christiansen <tchrist@chthon.perl.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]