just a question
lifeiscontent opened this issue · comments
@cgrand sorry to bother you, I'm not familiar with clojure so I was hoping you could explain the concept of how a sort transducer works maybe in pseudo code so I could implement one in JavaScript.
thanks in advance!
There’s no magic: the whole input is buffered, the sort only occurs when the upstream completes.
(closing as just a question, you can still comment to ask for more details)
@cgrand I see, so it's just a lazy transform? is it not composed? e.g. ['b', 'a'].map(x => x.toUpperCase()).sort()
@cgrand so in the case of composed vs not composed.
in a composed set of transforms everything is done in a single loop.
with a set of uncomposed transforms everything happens in a separate loop.
e.g.:
map -- loop 1
sort -- loop 2
I guess what I'm wondering here is if it's possible to both map/sort items within a single loop.