Hi all
do we agree that the following is the semantics of flatCollect:
testCollectUnion
self assert: ((#((1 2) (3 4) (5 3)) collectUnion: [ :each ])
equalsTo: #(1 2 3 3 4 5)).
self assert: ((#((1 2) (2 3) (1 3 4)) collectUnion: [:each])
equalsTo: #(1 1 2 2 3 3 4)).
self assert: ((#() asCollection collectUnion: [:each]) equalsTo: #()
asCollection) true.
self assert: ((#() asCollection collectUnion: [:each]) equalsTo: #()
asSet).
self assert: ((#((1 2) (1 2) (1 3 4)) asSet collectUnion: [:each])
equalsTo: #(1 1 2 3 4) asSet).
self assert: ((#() asSet collectUnion: [:each]) equalsTo: #() asSet).
we happen the results of the collect. Like a mapcan in LISP.
Is it ok for you?
Stef