--- a/Stack.st Thu Sep 26 20:45:58 2002 +0200
+++ b/Stack.st Mon Sep 30 17:59:25 2002 +0200
@@ -1,3 +1,5 @@
+"{ Package: 'stx:goodies/tgen' }"
+
OrderedCollection subclass:#Stack
instanceVariableNames:''
classVariableNames:''
@@ -56,69 +58,52 @@
!Stack class methodsFor:'instance creation'!
new
- ^self new: 100
+
+ ^ self new:100
! !
!Stack methodsFor:'accessing'!
pop
- "Answer the object on top of the stack."
+ "Answer the object on top of the stack."
^ self removeLast
-
- "Created: 7.2.1996 / 00:12:53 / stefan"
- "Modified: 7.2.1996 / 00:13:53 / stefan"
!
pop: numElem
- "Pop and discard top numElems and answer receiver"
+ "Pop and discard top numElems and answer receiver"
- self removeLast:numElem
-
- "Created: 7.2.1996 / 00:12:53 / stefan"
- "Modified: 7.2.1996 / 00:14:16 / stefan"
+ self removeLast:numElem
!
push: anObject
- "Push anObject onto the top of the stack."
+ "Push anObject onto the top of the stack."
^ self add:anObject
-
- "Created: 7.2.1996 / 00:12:53 / stefan"
- "Modified: 7.2.1996 / 00:14:52 / stefan"
!
top
- "Answer (without removing) the object on top of the stack."
+ "Answer (without removing) the object on top of the stack."
- ^self last
-
- "Created: 7.2.1996 / 00:12:54 / stefan"
- "Modified: 7.2.1996 / 00:15:26 / stefan"
+ ^ self last
! !
!Stack methodsFor:'enumerating'!
do: aBlock
- "Evaluate aBlock for each object on the stack, from top to bottom."
+ "Evaluate aBlock for each object on the stack, from top to bottom."
- ^ super reverseDo:aBlock
-
- "Created: 7.2.1996 / 00:12:53 / stefan"
- "Modified: 7.2.1996 / 00:16:00 / stefan"
+ ^ super reverseDo:aBlock
!
reverseDo: aBlock
- "Evaluate aBlock for each object on the stack, from bottom to top."
+ "Evaluate aBlock for each object on the stack, from bottom to top."
- ^ super do:aBlock
-
- "Created: 7.2.1996 / 00:12:54 / stefan"
- "Modified: 7.2.1996 / 00:16:18 / stefan"
+ ^ super do:aBlock
! !
!Stack class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Stack.st,v 1.3 1997-01-16 13:03:14 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Stack.st,v 1.4 2002-09-30 15:59:25 stefan Exp $'
! !