Stack class? - Smalltalk

This is a discussion on Stack class? - Smalltalk ; Hi, I was just looking for a Stack (pop, push ...) class in the image, didn't find one. Isn't there one, or is it just named differently? Günther...

+ Reply to Thread
Results 1 to 2 of 2

Stack class?

  1. Default Stack class?

    Hi,

    I was just looking for a Stack (pop, push ...) class in the image,
    didn't find one.

    Isn't there one, or is it just named differently?

    Günther

  2. Default Re: Stack class?


    >I was just looking for a Stack (pop, push ...) class in the image,
    >didn't find one.
    >
    >Isn't there one, or is it just named differently?


    I just use an OrderedCollection....

    oc := OrderedCollection new.
    oc addLast: something.
    .....
    tos := oc removeLast

    You can wrap it up in a "Stack" class but it seems a bit pointless.
    Apart from some bounds checking there's not a lot more you can do with a
    Stack is there :-)

    --
    Ian

    The from address is (currently) valid

+ Reply to Thread