Re: (1) and splitregexp, use of capture groups isn't officially supported 
in regular expressions in filters with the exception of the new 
search-replace operator. This probably needs to be better documented. 

However what is interesting here is that you report that it works in 
TiddlyDesktop. Was it the same TiddlyWiki file used in FF58 and in 
TiddlyDesktop? Or was the TiddlyDesktop file 5.1.22 or 5.1.23 pre-release?

Late in the 5.1.23 pre-release phase, filters were switched to using a 
linked list implementation instead of an array for performance purposes. I 
wonder if perhaps the new linked list implementation is less tolerant than 
than the old implementation for undefined values, and that there has been a 
regression.


Re: (2) use single, double or triple quotes around arguments. The <<__x__>> 
syntax was introduced precisely for those situations where getting the 
quoting of parameters correct might be tricky.


Re: (3)  One of the important differences between the Set and Vars widgets 
is that:

   -  the Set widget directly supports filters and (used in the filtered 
   item variable assignment form) assigns a title list 
   <https://tiddlywiki.com/#Title%20List> to the variable (which can hold 
   multiple titles).
   -  However the Vars widget does not directly support filters and using a 
   filtered attribute assignment using the triple brace syntax assigns the 
   first title from the filter results to the variable. To be clear this isn't 
   really down to the Vars widget but rather the way filtered attributes 
   for widgets are evaluated 
   
<https://github.com/Jermolene/TiddlyWiki5/blob/d56e8764a1f02a214df5da1cc95191be2da2491b/core/modules/widgets/widget.js#L270>,
 
   i.e. attribute={{{ filter }}} which always assigns the first title from the 
   filter results.

Hope this helps,
Saq
On Tuesday, March 2, 2021 at 10:18:33 PM UTC+1 [email protected] wrote:

> Good day,
>
> Triggered by the announcement of Tamasha I decided to dig into TW5 some 
> more. Therefore I created a --javascript free -- plugin for easy import and 
> display of spreadsheet data, or more generally dataframes. Along the way I 
> ran into some subtleties / miscomprehensions of the tiddlywiki framework , 
> which might be of interest to others. A demonstration of the dataframe 
> plugin and  a working description of three subtleties in action is 
> available at: https://hwvandijk.bitbucket.io/tw-dataframe/
>
> 1. splitregexp that crashes the Javascript engine of Firefox 58, but works 
> on tiddlydesktop 0.14 (chromedriver 81)
> I used a (elaborate) regular expression in splitregexp to split "ABC123" 
> in to "123 ABC" in one go. 
> i.e.
> regexp="([A-Z]+(?=[0-9]+))|([0-9]+(?=[A-Z]+))"  
> and filter="[<ref>splitregexp<regexp>reverse[]]"
>
> I get a Javascript error: *uncaught exception: Linked List only accepts 
> string values, not undefined *
> The problem has been solved by using a more straightforward regular 
> expression in a  search-replace:regexp filter operator.
>
> 2. $x$ and <<__x__>> or similar but not identical
> I had problems using macro parameters in filters. Therefor I cast them in 
> a <$set> or <$vars> variable, either through $x$ or <<__x__>>. The former 
> works fine unless a parameter x that is passed to the macro contains 
> slashes.
> <<mymacro one.2.three> works fine, <<mymacro one/2/three>> fails. It 
> renders the <$vars expression> literally in the page.
>
> 3. <$set filter:"filter" variable="var"> and <$vars var={{{ filter }}}> 
> give different results
> To specify the index/columns of the dataframe  to be displayed I use a 
> list of ranges. Meaning that a spec of "1,3-5,7" should be transformed into 
> "1,1 3,5 7,7" such that when you feed these entries one by one into the 
> range operator you get [1 2 3 4 5 7]. 
> However with:
>
> <$vars p=<<__param__>> 
>       regexp="^(\d+)$" > 
> <$set name="setref" 
> filter="[<p>split[,]search-replace:g:regexp<regexp>,[$1,$1]]" >
> <$vars varsref={{{ [<p>split[,]search-replace:g:regexp<regexp>,[$1,$1]] 
> }}} >
>
> The variables *setref* and *varsref* are not identical. *varsref* is 
> wrong, you should use *setref*.
> varsref only works for simple specifications, such as "7". It looks like 
> *varsref 
> *does not obey the g (global) specifier.
>  
> Sorry for the long mail, but hopefully someone can point out my 
> misconceptions or file a bug if that is appropriate.
>
> Cheers,
>
> Hylke van Dijk
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/250f8701-228c-4c78-bacf-58e0fc18ae6cn%40googlegroups.com.

Reply via email to