Hi Mal > In another thread, there was some discussion about the split operator. It > exhibits some interesting behaviour when using split[] with no arguments: > it produces a list of single characters from the input string - this seems > like a sensible edge case behaviour. Yes, it's exposing the way that the underlying JavaScript "split" function works, where it is a common idiom for working on the individual characters of a string. > it does not exhibit the usual uniqueness property of filter lists - > duplicates are passed through to the output. It's surprising but individual operators can return result lists with duplicates. The enforcement of uniqueness is performed when the result lists of multiple runs are merged. But there are also situations where the system assumes that duplicates have already been removed. For example, this returns "jeremy" as expected:
[[jeremy]split[]] +[join[]] But this returns "jremye": [[jeremy]split[]] e +[join[]] The subtlety is that the additional run consisting of the letter "e" dedupes the first of the first letter "e", but fails to "see" the second". > The output can include single space characters - this is tricky considering > lists are space delimited. There's less mystery here: spaces are used for delimiting lists when they are serialised into a string, but internally lists are held as arrays. > Are these behaviours by design and will continue to exist in the final > release of 5.1.20 and subsequent releases? If so, the split operator can be > used for some useful string manipulation hacks. Yes to both questions. It's pretty clear now that the way that de-duplication is implemented was a mistake. I don't think we can fix it while retaining 100% backwards compatibility. As discussed in this ticket, I'm now of the opinion that we need to fix this: https://github.com/Jermolene/TiddlyWiki5/issues/3757 Best wishes Jeremy > > Regards, > > Mal > > > -- > You received this message because you are subscribed to the Google Groups > "TiddlyWiki" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/tiddlywiki. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywiki/140182eb-2acf-4299-b172-c6899822d32e%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/D192654D-CFB1-4466-B310-FE735835F1E3%40gmail.com. For more options, visit https://groups.google.com/d/optout.

