'From etoys3.0 of 24 February 2008 [latest update: #2081] on 23 September 2008 at 11:02:20 pm'! !SequenceableCollection methodsFor: 'nil' stamp: 'yo 9/23/2008 22:53'! after: target ifAbsent: exceptionBlock "Answer the element after target. Answer the result of evaluation the exceptionBlock if target is not in the receiver, or if there are no elements after it." | index | index _ self indexOf: target. ^ index == 0 ifTrue: [exceptionBlock value] ifFalse: [index = self size ifTrue: [exceptionBlock value] ifFalse: [self at: index + 1]]! ! !SequenceableCollection methodsFor: 'nil' stamp: 'yo 9/23/2008 22:53'! before: target ifAbsent: exceptionBlock "Answer the receiver's element immediately before target. Answer the result of evaluating the exceptionBlock if target is not an element of the receiver, or if there are no elements before it." | index | index _ self indexOf: target. ^ index == 0 ifTrue: [exceptionBlock value] ifFalse: [index == 1 ifTrue: [exceptionBlock value] ifFalse: [self at: index - 1]]! ! SequenceableCollection removeSelector: #errorFirstObject:! SequenceableCollection removeSelector: #errorLastObject:!