Imagine a subclass of Collection
that knows a select
block and a collect
block. An instance of this class wraps another collection
and dynamically applies to it these blocks. So, for instance, #do:
is implemented as
do: aBlock
collection
select: [:element | select value: element]
thenDo: [:element | | v |
v := collect value: element.
aBlock value: v]]
So, the question is how should I name this class? I've called it WrappedCollection
but this name is ambiguous and, besides, this thing must already exist and have a name.
By the way, this is very similar to Subclassing Stream, except that mine is not a Stream
.