In <199509141147.HAA14720@bigboote.WPI.EDU>
On Thu, 14 Sep 1995 07:46:33 -0400
Terry Greenlaw <z50816@mip.lasc.lockheed.com> writes:
>> In <199509121854.NAA20361@falcon.mbsa.com>
>> On Tue, 12 Sep 1995 13:54:27 -0500
>> Doug Maxey <dwm@mbsa.com> writes:
>> >I go with Terry on this, Pack is a class with methods,
>
>> It isn't, it is a mis-mash of functions with obscure syntax ;-)
>
>We can fix that. We have the knowledge. We know the odds. We can cast Lee
>Majors to help. ;-}
I don't understand that - unless it is a reference to "$6M Man".
I am moving discussion to perl5-porters as it is more about perl than Tk,
when we have semantics sorted we can move it back.
>
>> >and calling
>> >the instance would be The Right Way (tm:).
>
>> $w->Pack::info is not the "Right Way" at all - $w is not an instance
>> of 'Pack' it is an instance of some widget.
>
>Pack::info in this case is a static method "info" in class "Pack" in
>superclass "Tk".
We are getting bogged down in jargon, but I still think you and I have
different ideas from eachother as two what anything->Package::method
actually does in perl.
>Unfortunately, the better syntax to insure inheritance (sorry I missed this
>one, Larry) and namespace isolation is Tk->Pack::info($w), which is pretty
>different from existing syntax.
It also does not do anything for namespace isolation, as I understand it
once there is a :: in the name then perl abandons inheritance and uses
thing to right of -> as fully qualified name. Thus this is still calls
package Pack; # top level name
sub info
And just happens to pass 'Tk' as 1st arg.
That is why perlbot has :
package Foo;
@ISA = qw( Bar Baz );
@Foo::Inherit::ISA = @ISA; # Access to overridden methods.
$self->Foo::Inherit::goo();
If it worked they way you imply - i.e. left hand side of -> affects
the method actually called then the neater :
$self->Inherit::goo();
Would suffice.
>The object->method syntax seems to lead
>people into thinking that every method HAS to be virtual. I'm not sure about
>perl, but static methods are much faster than virtual methods in most other
>(all other???) languages. Then again, I'm writing this at 7:00 AM, so rational
>thought is likely to be virtual as well.
>
On Thu, 14 Sep 1995 07:46:33 -0400
Terry Greenlaw <z50816@mip.lasc.lockheed.com> writes:
>> In <199509121854.NAA20361@falcon.mbsa.com>
>> On Tue, 12 Sep 1995 13:54:27 -0500
>> Doug Maxey <dwm@mbsa.com> writes:
>> >I go with Terry on this, Pack is a class with methods,
>
>> It isn't, it is a mis-mash of functions with obscure syntax ;-)
>
>We can fix that. We have the knowledge. We know the odds. We can cast Lee
>Majors to help. ;-}
I don't understand that - unless it is a reference to "$6M Man".
I am moving discussion to perl5-porters as it is more about perl than Tk,
when we have semantics sorted we can move it back.
>
>> >and calling
>> >the instance would be The Right Way (tm:).
>
>> $w->Pack::info is not the "Right Way" at all - $w is not an instance
>> of 'Pack' it is an instance of some widget.
>
>Pack::info in this case is a static method "info" in class "Pack" in
>superclass "Tk".
We are getting bogged down in jargon, but I still think you and I have
different ideas from eachother as two what anything->Package::method
actually does in perl.
>Unfortunately, the better syntax to insure inheritance (sorry I missed this
>one, Larry) and namespace isolation is Tk->Pack::info($w), which is pretty
>different from existing syntax.
It also does not do anything for namespace isolation, as I understand it
once there is a :: in the name then perl abandons inheritance and uses
thing to right of -> as fully qualified name. Thus this is still calls
package Pack; # top level name
sub info
And just happens to pass 'Tk' as 1st arg.
That is why perlbot has :
package Foo;
@ISA = qw( Bar Baz );
@Foo::Inherit::ISA = @ISA; # Access to overridden methods.
$self->Foo::Inherit::goo();
If it worked they way you imply - i.e. left hand side of -> affects
the method actually called then the neater :
$self->Inherit::goo();
Would suffice.
>The object->method syntax seems to lead
>people into thinking that every method HAS to be virtual. I'm not sure about
>perl, but static methods are much faster than virtual methods in most other
>(all other???) languages. Then again, I'm writing this at 7:00 AM, so rational
>thought is likely to be virtual as well.
>