Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Property Inheritance

6 views
Skip to first unread message

David Wheeler

unread,
Apr 30, 2003, 9:55:47 PM4/30/03
to perl6-l...@perl.org
Hi All,

Quick question: In Perl 6, if I declare a method with some properties,
and then override that method in a subclass, will the overridden method
inherit the properties of the SUPER method?

Thanks,

David

--
David Wheeler AIM: dwTheory
da...@kineticode.com ICQ: 15726394
Yahoo!: dew7e
Jabber: The...@jabber.org
Kineticode. Setting knowledge in motion.[sm]

Luke Palmer

unread,
May 1, 2003, 12:51:41 AM5/1/03
to da...@wheeler.net, perl6-l...@perl.org
> Hi All,
>
> Quick question: In Perl 6, if I declare a method with some
> properties, and then override that method in a subclass, will the
> overridden method inherit the properties of the SUPER method?
>
> Thanks,
>
> David

I think it depends on the property. For the properties mentioned in
A6, I can't think of one you wouldn't want to inherit. But eventually
there may emerge traits that you wouldn't want to inherit.

In fact, it may be the fact that traits inherit by default that makes
traditional, "code" inheritance work at all, considering that C<do> is
a trait in itself.

Luke

David Wheeler

unread,
May 1, 2003, 12:54:50 AM5/1/03
to Luke Palmer, perl6-l...@perl.org
On Wednesday, April 30, 2003, at 11:51 PM, Luke Palmer wrote:

> I think it depends on the property. For the properties mentioned in
> A6, I can't think of one you wouldn't want to inherit. But eventually
> there may emerge traits that you wouldn't want to inherit.
>
> In fact, it may be the fact that traits inherit by default that makes
> traditional, "code" inheritance work at all, considering that C<do> is
> a trait in itself.

Okay, cool. I take it, then, that traits can be overridden in
subclasses?

0 new messages