Re: better flatten()?

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...

Considering that you apparently seem to be the original author of that phrase, and the delim functionality of flatten() itself in the first place, I think you would know that best.

Yeah ... you'd think so, right? Oh well ... I can't remember doing any of those changes to Jeremy's original code.

jimcbrown said...

(I would suggest modifying the docs to make that more explict in the future however: 'An optional delimiter to place after each flattened sub-sequence (except if the sub-sequence is the last element).')

I might if I could work out Hg. (That software is sooooo unintuitive, IMO)

jimcbrown said...

I am curious as to the rationale, though, of distinguishing between the two cases. That is, why should flatten() only insert a delimiter up to the last subsequence (or last element that is a sequence), and continue to append atomic elements after that without a delimiter? Seems to open the door to other kinds of weird cases. (E.g. if flatten() is passed a sequence that is already flat, and also given a delimiter, should merely return the original string or should it insert a delimiter between each of the atomic elements?)

I don't know. I have not really had a need to use this function.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu