Front page | perl.perl5.porters |
Postings from January 2000
Re: On Pseudohashes
From:
Nick Ing-Simmons
Date:
January 16, 2000 14:15
Subject:
Re: On Pseudohashes
Message ID:
E129xwm-0006uO-00@mserv1c.u-net.net
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