Thread SUPER: Ich bin am verzweifeln ... (15 answers)
Opened by BrownWolf at 2003-09-03 17:53

BrownWolf
 2003-09-03 18:38
#83555 #83555
User since
2003-08-15
308 Artikel
BenutzerIn
[default_avatar]
Das Buch: Objektorientiert Programmieren von Damian Conway.

Dort sind auch viele Fehler im Code. Zum Beispiel hier:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Settable;

sub new {
my($class,$set) = @_;
my $self = { Settable_set => $set };
return bless $self, $class;
}

sub set {
my ($self) = @_;
$self->{Settable_set} = 1;
}

package Collection; 

@ISA = qw(Settable);

sub new {
my($class, %items) = @_;
my $self = $class->SUPER::new();

self->{Collection_set} = { %items };
return $self;
}

sub list {
my($self) = @_;
print keys %{$self->{Collection_set}};
}


Genau so stehts im Buch ;)\n\n

<!--EDIT|BrownWolf|1062600157-->
Code (perl): ()
1
2
3
sub _{s;;xrqIpiql\\{}p{pl{R>rl{N{}gjwpkssq]>rl{N;;;*{{}=*{_};;
&#36{{}={q{{{}}}=>[reverse+split+reverse+q;}{;]};&#36{{}->{q{{{}}}}->[@{{}];}
&#36{{}=reverse+_(q{{}}=>q{{}})^chr(30)x+length&_(q{{}}=>,q{{}})and+print;

View full thread SUPER: Ich bin am verzweifeln ...