Re: RFC 218 (v1) C<my Dog $spot> is just an assertion

[email protected] (Chaim Frenkel) 14 Sep 2000 00:04:03 -0400
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
>>>>> "NT" == Nathan Torkington <[email protected]> writes:

NT> Every compile-time check comes at the cost of a run-time freedom,
NT> though.  All bets would be off if you modified @ISA, reblessed, or
NT> passed objects through non-strict-types-compliant code.  Polymorphic
NT> types also becomes a problem: how to say that it's okay for a variable
NT> to hold a Dog *or* a Cat, because we know that both of them have a
NT> "pet()" method?

Inheretence of interface?

my Pet $Fido = $Cat->new;
my Pet $Felix = $Dog->new;


# Nothing but declarations.

Package Pet;

sub Feed();
sub Play();
sub Wash();
sub Pet();

Though how to tell perl to enforce it.

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
[email protected]				               +1-718-236-0183