On 01/10/02 16:04 -0400, Benjamin Goldberg wrote:
> Brian Ingerson wrote:
> [big body of message]
>
> Some parts of your suggestion don't sit well with me.
Good suggestions. This implementation was just thrown together to start
a more formal discussion of complex keys and the possibility of using
them in the default language. But thanks for the fixes.
Cheers, Brian
>
> First:
>
> + # Blessed objects HASH themselves (see UNIVERSAL::HASH below)
> + elsif ($k =~ /=/ and $k->can('HASH')) {
> + $k->HASH();
> + }
>
> It does an unncessary stringification of $k here, and it uses the ->can
> method (which may have been overridden to do something funky).
>
> # Blessed objects HASH themselves (see UNIVERSAL::HASH below)
> elsif( UNIVERSAL::can($k, 'HASH') ) {
> $k->HASH();
> }
>
> Which avoids action-at-a-distance from stringification or ->can().
>
> Next:
>
> + # Else just use *identity*
> + else {
> + "$k";
> + }
>
> If $k overloads '""', this isn't exactly identity.
>
> # Else just use *identity*
> else {
> $INC{'overload.pm'} ? overload::StrVal($k) : "$k";
> }
>
> (Which fails if something does overloading without first loading
> overload.pm, which possible but unlikely).
>
> --
> How many Monks would a Chipmonk chip,
> if a Chipmonk could chip Monks?
Thread Previous
|
Thread Next