On Sat, Sep 16, 2000 at 10:31:55AM +0100, Hildo Biersma wrote:
> AFAIK, most of the pain in the implementation is caused because any old
> array can be 'promoted' into a pseduo-hash at any-time. If
> pseudo-hashes always have to be pre-declared (eg, can only be created
> through fields::new()) and only support he hash-interface (not array),
> much of that pain could go away.
fields::new() does smooth things out a little bit, but it doesn't win
much. It guarantees that $ph->[0] will be filled in with \%{ref
$ph.'::FIELDS'} and also guarantees that $ph will be an object. That
solves the problems of inconsistancies between typed and untyped
access, but little else.
Pseudo-hashes are not a good/clean way to implement typed objects.
Why? Can't do multiple inheritence (without *alot* of contortions).
And there's also the inefficiencies of untyped pseudo-hash access.
Pseudo-hashes made some sense in the restrictions of Perl 5 syntax,
but we've got room now to rethink the problem from scratch.
--
Michael G Schwern http://www.pobox.com/~schwern/ [EMAIL PROTECTED]
Just Another Stupid Consultant Perl6 Kwalitee Ashuranse
But unluckily most Germans here are too smart. They all speak good English
and won't be able to speak German to me.
--Alex Chiu, Immortality Guy