31 ifTrue: [first := link. last := link]
32 ifFalse: [last next: link. last := link].
67 whileTrue: [aBlock value: link value.
73 aStream := WriteStream on: (self species new: self size).
76 whileTrue: [(aBlock value: link value)
77 ifTrue: [aStream nextPut: (link value)].
84 aStream := WriteStream on: (self species new: self size).
87 whileTrue: [aStream nextPut: (aBlock value: (link value)).
98 [ (link ~= nil) & (i < index) ]
99 whileTrue: [ i := i + 1. link := link next].
101 self assert: [ link ~= nil ].
110 (index < 1) | (index > size)
111 ifTrue: [self error: 'out of bounds' ].
113 link := self findLink: index.
117 at: index put: anObject
122 (index < 1) | (index > size)
123 ifTrue: [self error: 'out of bounds' ].
125 link := self findLink: index.
126 link value: anObject.
157 removed := first value.
159 ifTrue: [first := nil. last := nil]
160 ifFalse: [first := first next].
171 removed := last value.
173 ifTrue: [first := nil. last := nil]
174 ifFalse: [link := first.
176 whileFalse: [ link := link next].
184 remove: anObject ifAbsent: aBlock
188 link ifNil: [^ aBlock value].
190 link value = anObject
191 ifTrue: [first == last
192 ifTrue: [last := nil].
194 ifFalse: [[link next ifNil: [^ aBlock value].
195 link next value ~= anObject]
196 whileTrue: [link := link next].
197 link next: link next next].
205 first == nil ifTrue: [ self error: 'list is empty' ]!