in reply to Re: Calling Madness
in thread Calling Madness

ref $_[0] eq "PKG"
That will break inheritance, though. You really need UNIVERSAL::isa there instead, like in broquaint's post.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: Calling Madness
by rir (Vicar) on Sep 15, 2002 at 20:38 UTC
    As Aristotle says, ref $_[0] eq "PKG" will break inheritance.

    I think that illustrates a serious problem with the concept. I took the stance that:
    Class::derived( $not_blessed); should do the same as:
    $class->derived( $not_blessed); and decided that inheritance was not allowed because the first form was desired.

    If allowing naive users to use the various calling conventions
    was the idea, and why else, I thought this was the clear choice.

    The following, and more, need to be considered:

    Class::derived( $class_obj); # Jack Class::derived( Class $not_blessed); # Queen Class->derived( $not_blessed); # King $class_obj->derived( $not_blessed); # Ace Class::derived( "Class", $not_blessed); # Joker

    The last is the joker. How will you distinguish between the Joker and the Queen?
    And what about Jack? Is that the same as:  $class_obj->derived;
    or the same as:  $class_obj->derived( $class_obj);

      Class::derived($class_obj) is the same as $class_obj->derived() except it disables late binding.

      Makeshifts last the longest.

        Class::derived($class_obj) is the same as $class_obj->derived() except it disables
        late binding.

        Right. I am suitably rebuked.

        I didn't mean that they were the same. But that when someone
        tries to make the differing call invocations the same to warp the language,
        the apparently correct semantics change.