racket/collects/honu/examples/old/Stack-main.honu
Stevie Strickland 7dbb99d3c6 merged 292:296 from branches/sstrickl
svn: r297
2005-07-02 04:03:02 +00:00

26 lines
466 B
Plaintext

IStack main() {
IStack x = new CountedListStack : IStack();
IStack y = null;
x.push(new CharBox : Character(value = '5'));
x.push(new IntBox : Integer(value = 3));
y = x.copy();
while(!y.empty()) {
Any curr = y.pop();
if curr isa Character {
printLine("Got a character");
} else {
if curr isa Integer {
printLine("Got an integer");
} else {
printLine("Got something else");
};
};
};
x;
}