Yes and yes. In Dunaj this is called the unpacked reduction, and there is IUnpackedRed protocol that is used by coll implementations to provide reduce-kv like functionality. Please see this example on how Dunaj handles reductions with >2 arguments. No intermediate tuples are created when using unpacked reduction...
https://www.refheap.com/98510 Jozef On Wednesday, March 18, 2015 at 1:05:16 AM UTC+1, Herwig Hochleitner wrote: > > 2015-03-12 12:15 GMT+01:00 Jozef Wagner <jozef....@gmail.com <javascript:> > >: > >> >> Experiment #5: Reducers First >> >> > Wow! There are some great ideas on how to unify reducers with lazy-seq. > > Have there yet been thoughts on how reduce-kv could fit in a reducer stack? > > Obviously, the notion of a transducer could be extended to allow distinct > input- and output arities, which would fit into reducing-fn arities > 2. > But could this be made to interact smoothly with tuple-taking and > -producing functions? > > I've done some exploratory programming on this in the past [1], and it > turned out a pretty decent map-handling lib, that comes in handy > frequently. Still, only the formulation of transducers opened my eyes to > the possibility of efficient multiple-return-values by using transducers in > the style of reduce-kv. > > kind regards > > [1] https://github.com/webnf/webnf/blob/master/base/src/webnf/kv.clj > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.