Hmm, in its current form the 5.1.20 'split' operator *can* be used to 
"listify" a string and preserve duplicates... *but* it does not respect the 
TW convention of enclosing values with double square brackets when they 
contain spaces. As an example, in 5.1.20-prerelease:

<$set name="HasDuplicates" value="*one two two three [[twenty one]] 
[[twenty one]] [[forty six]]*">

<$list filter="[<HasDuplicates>split[ ]]">

</$list>

results in:

one <https://tiddlywiki.com/prerelease/#one>
two <https://tiddlywiki.com/prerelease/#two>
two <https://tiddlywiki.com/prerelease/#two>
three <https://tiddlywiki.com/prerelease/#three>
[[twenty <https://tiddlywiki.com/prerelease/#%5B%5Btwenty>
one]] <https://tiddlywiki.com/prerelease/#one%5D%5D>
[[twenty <https://tiddlywiki.com/prerelease/#%5B%5Btwenty>
one]] <https://tiddlywiki.com/prerelease/#one%5D%5D>
[[forty <https://tiddlywiki.com/prerelease/#%5B%5Bforty>
six]] <https://tiddlywiki.com/prerelease/#six%5D%5D>

The duplicate entries are, indeed, preserved. Unfortunately, the double 
square brackets are treated as regular characters.

It would be necessary to use tabs, or more exotic characters, as a value 
delimiter when values may contain spaces. This means the user has to 
remember different data-encoding conventions for different operations, and 
in the worst case the same data may have to be stored in multiple formats. 
Also, it's human-unfriendly to work with tabs and spaces in the same 
strings when they have different semantic meanings :-)

My quixotic quest for a drop in enlist-but-with-duplicate-preservation 
replacement continues...

I'll start a fresh topic about that broader question.

Regards,
David.

On Tuesday, 23 April 2019 21:02:28 UTC+9:30, David Nebauer wrote:
>
>
> Note: I am aware that TW 5.1.20 will have a split operator that retains 
> duplicates, but I'm hoping for a solution in days rather than [*insert TW 
> 5.1.20 release schedule here*].
>

-- 
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/5f043d76-52a5-46f7-a9ba-263391891829%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to