Hallo everyone, how do I append to a list of items through different 
cycle-runs of the code? The most intuitive way to do it would be haveing a 
variable that stores my list, but as far as I can see, in Tiddlywiki you 
cannot assign to a 'variable' other than at declaration time.
Once you have written <$set name="myVar" value="whatever">, it's not 
possible to assign to myVar, as

    <$set name="myVar" value="whatever">
          ...
          myVar="some other value"
    </$set>

and because of that, it becomes very hard to incrementally append items to 
a list of items from within different cycle-runs of a <$list> widget.

The only 'variables' you can assign to in Tiddlywiki seem to be tiddlers' 
fields and/or indexes, but this cannot be done other than interactively, by 
means of action-widgets like action-setfield and interactive elements like 
buttons, checkboxes etc.
Moreover, you have to desperately squeeze all the processing logic of 
filters inside widgets (<$list> or <$set> for the most part), so this chunk 
of code, which would be a snap in every other programming environment, is 
not correct and it is horribly hard to write an equivalent that is 
syntactically correct:

<$set name="myList" value="">
    <$list filter="[tag[dict_entry]match[keyword]]" 
               variable="db_hit">
           [<myList>append<db_hit>]<!--filters cannot 'live' alone-->
    </$list>
        
        [[myList]sort[]]+[unique[]]<!--filters cannot 'live' alone-->
        Entries matching keyword: <<myList>>
</$set>

As one can see, the reason why I need to store the output of every 
cycle-run of the <$list> inside a list variable instead of just outputting 
it to screen is that I might want to process my list when I'm done 
appending to it (removing duplicates for example) before outputting it, as 
in the (syntactically wrong) statement

        [[myList]sort[]]+[unique[]]

Tiddlywiki is a great platform to process text, I can guess its huge 
potentiality, but lacking true variables (and if-then-else flow branching, 
and functions) is an horribly frustrating restriction, it takes me hours, 
if not days, to try and write code that would take me minutes in other 
environments to write, and most of the time I end up giving in...


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8169b956-7b56-48ec-aafd-220b4b438c75n%40googlegroups.com.

Reply via email to