From f450ca7aa81aa30428a14d28b5f2324c12715d3f Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 8 Aug 2023 10:49:46 -0300 Subject: [PATCH] Add OrderedSet>>#reverse Fix SequenceableCollection>>#anyOne --- .../SequenceableCollection.extension.st | 6 ++++++ source/Buoy-Collections/OrderedSet.class.st | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/source/Buoy-Collections-GS64-Extensions/SequenceableCollection.extension.st b/source/Buoy-Collections-GS64-Extensions/SequenceableCollection.extension.st index eaa9b5a..bb0efa5 100644 --- a/source/Buoy-Collections-GS64-Extensions/SequenceableCollection.extension.st +++ b/source/Buoy-Collections-GS64-Extensions/SequenceableCollection.extension.st @@ -1,5 +1,11 @@ Extension { #name : #SequenceableCollection } +{ #category : #'*Buoy-Collections-GS64-Extensions' } +SequenceableCollection >> anyOne [ + + ^ self first +] + { #category : #'*Buoy-Collections-GS64-Extensions' } SequenceableCollection >> copyAfter: anElement [ "Answer a copy of the receiver from after the first occurrence diff --git a/source/Buoy-Collections/OrderedSet.class.st b/source/Buoy-Collections/OrderedSet.class.st index 43436e4..1923a98 100644 --- a/source/Buoy-Collections/OrderedSet.class.st +++ b/source/Buoy-Collections/OrderedSet.class.st @@ -209,6 +209,12 @@ OrderedSet >> removeAll [ collection removeAll ] +{ #category : #converting } +OrderedSet >> reverse [ + + ^ self reversed +] + { #category : #converting } OrderedSet >> reversed [