> Le 24 août 2019 à 09:29, Steffen Märcker <merk...@web.de> a écrit :
>
> Hi Julien,
Hello Steffen,
>
> nice work! Could you please tell how your approach is related to
> transducers from the user perspective and technically?
> (https://github.com/Pharophile/Transducers)
It is quite similar, except that I actually started it the other way around:
- First I wanted objects that can iterate on data structure (or any object)
- Second I wanted object to eventually provide multiple iterators in order to
walk them in multiple ways
- Third I came with the IteratorWithCollectionAPI decorator which implements
#select:, #collect: and so one in order to avoid re-implementing these methods
on objects wrapping a collection
- Since IteratorWithCollectionAPI is a decorator, I came up with the idea to
push further the composition feature and at this point, I get Iterators to be
similar to Transducer
The original idea of Iterators can be summarised as:
myObjectThatShouldImplementCollectionButIsNotACollection iterator collect: #foo.
myObjectThatShouldImplementCollectionButIsNotACollection iterator do: #foo.
myObjectThatShouldImplementCollectionButIsNotACollection iterator doWithIndex:
#foo.
…
Technically I don’t know what are the similarities as I did not dig in
Transducers implementation.
From the DSL design point of view, I wanted that the composition through binary
messages keeps the data flow to go from top left to down right when you read
the code.
This gave me the idea to mimic shell language for stream manipulation.
Hope it answers your questions.
Cheers,
Julien