I'm reading a book using VisualWorks and I try to write the code in GNU Smalltalk. I have this:
OrderedCollection subclass: Stack [
push: anObject [
self addLast: anObject.
]
pop [
self isEmpty
ifTrue: [^nil]
ifFalse: [^self removeLast].
]
]
| st |
st := Stack new.
st push: 'a'.
Transcript show: st pop.
but it doesn't work. Can someone please explain me what am I doing wrong?