class CPList
pri next : CPList;
pri info : Object;
meth Setnext =^ ( val n: CPList ·
next:= n;
)
end
meth Getnext =^ ( res n: CPList ·
n:= next;
)
end
meth Setinfo =^ ( val o: Object ·
info:= o;
)
end
meth Getinfo =^ ( res o: Object ·
o:= info;
)
end
meth FindCPList =^ ( val count: Int;
res entry: CPList ·
var next: CPList ·
if [] count = 1 -> entry:= self;
[] count > 1 ->
self.GetNext(next);
next.FindCPList(count-1, entry);
fi
end
)
end
end