cl-transducers
cl-transducers copied to clipboard
More generic concatenate?
t:concatenate is bound to using lists as input, which doesn't make sense when all inputs are vectors and the reducer is t:vector. Should t:concatenate look at input to determine if t:list-reduce or t:vector-reduce should be used? Or hardcode knowledge of t:vector as reducer to convert input to a vector if needed?
I just copy/pasted t:concatenate to a version using t:vector-reduce and use that, but it's a bit dirty.
Check out the first-pass of the PR I just pushed. I still need to add a proper Condition for when the input isn't a list/vector/string, as well as some unit tests.
Hi there, any thoughts?
Hi there, any thoughts?
I have an alternative which works for all types of sources without hardcoding them: https://github.com/fosskers/cl-transducers/issues/8#issuecomment-2056741427