Inheritance/Single: Difference between revisions
Content deleted Content added
added python |
added perl, hopefully it's right |
||
Line 97: | Line 97: | ||
(*functions go here...*) |
(*functions go here...*) |
||
end</ocaml> |
end</ocaml> |
||
=={{header|Perl}}== |
|||
<perl>package Animal; |
|||
#functions go here... |
|||
1;</perl> |
|||
<perl>package Dog; |
|||
use Animal; |
|||
@ISA = qw( Animal ); |
|||
#functions go here... |
|||
1;</perl> |
|||
<perl>package Cat; |
|||
use Animal; |
|||
@ISA = qw( Animal ); |
|||
#functions go here... |
|||
1;</perl> |
|||
<perl>package Lab; |
|||
use Dog; |
|||
@ISA = qw( Dog ); |
|||
#functions go here... |
|||
1;</perl> |
|||
<perl>package Collie; |
|||
use Dog; |
|||
@ISA = qw( Dog ); |
|||
#functions go here... |
|||
1;</perl> |
|||
=={{header|Python}}== |
=={{header|Python}}== |