RosettaCodeData/Task/Generic-swap/Smalltalk/generic-swap.st

9 lines
129 B
Smalltalk
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
OrderedCollection extend [
swap: a and: b [
|t|
t := self at: a.
self at: a put: (self at: b).
self at: b put: t
]
]