mikelevins / folio2

new major version of folio
Other
76 stars 1 forks source link

Interposed finite series is infinite #3

Closed akater closed 6 years ago

akater commented 6 years ago

Interposing an item between elements of a finite series evaluates to infinite series:

(take 10 (interpose :item (scan-range :upto 3)))
=>
#Z(0 :ITEM 1 :ITEM 2 :ITEM 3 :ITEM :ITEM :ITEM)

Was it a deliberate design decision or is this a bug?

akater commented 6 years ago

I'm now sure it's a bug since the present behaviour of interleave and interpose on series does not match their own behaviour on other (generalised) sequences. See https://github.com/mikelevins/folio2/pull/4#issue-171278406 for an example.