cl-transducers icon indicating copy to clipboard operation
cl-transducers copied to clipboard

More generic concatenate?

Open simendsjo opened this issue 1 year ago • 3 comments

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.

simendsjo avatar Mar 26 '24 13:03 simendsjo

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.

fosskers avatar Mar 26 '24 23:03 fosskers

Hi there, any thoughts?

fosskers avatar Apr 08 '24 01:04 fosskers

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

simendsjo avatar Apr 15 '24 12:04 simendsjo