--- a/Stack.st Tue Jan 14 16:26:03 1997 +0100
+++ b/Stack.st Thu Jan 16 14:03:14 1997 +0100
@@ -1,12 +1,58 @@
-'From Smalltalk/X, Version:2.10.8 on 12-feb-1996 at 15:36:51' !
-
OrderedCollection subclass:#Stack
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
- category:'T-gen-Scanning/Parsing'
+ category:'Collections-Ordered'
+!
+
+!Stack class methodsFor:'documentation'!
+
+documentation
+"
+ a simple implementation of a Stack.
+
+ [author:]
+ Stefan Vogel
+
+ [see also:]
+ OrderedCollection Queue
+"
!
+examples
+"
+ push-push-....
+ [exBegin]
+ |aStack|
+
+ aStack := Stack new.
+ Transcript showCR:aStack.
+ Transcript showCR:'push 1: '.
+ aStack push:1.
+ Transcript showCR:'push 2: '.
+ aStack push:2.
+ Transcript showCR:'push 3: '.
+ aStack push:3.
+ Transcript showCR:aStack.
+ Transcript show:'pop: '; showCR:(aStack pop).
+ Transcript show:'pop: '; showCR:(aStack pop).
+ Transcript show:'pop: '; showCR:(aStack pop).
+ Transcript showCR:aStack.
+ [exEnd]
+
+ popping too many:
+ [exBegin]
+ |aStack|
+
+ aStack := Stack new.
+ aStack push:1.
+
+ aStack pop.
+ aStack pop.
+ [exEnd]
+"
+! !
+
!Stack class methodsFor:'instance creation'!
new
@@ -71,3 +117,8 @@
"Modified: 7.2.1996 / 00:16:18 / stefan"
! !
+!Stack class methodsFor:'documentation'!
+
+version
+ ^ '$Header: /cvs/stx/stx/libbasic2/Stack.st,v 1.3 1997-01-16 13:03:14 cg Exp $'
+! !