OK, so judging from your neat writeup in Passing Macro Parameters with Slashes <https://hwvandijk.bitbucket.io/tw-dataframe/#Passing%20Macro%20parameters%20with%20slashes> I'd say it *is *syntactical errors. This:
x=$p$ definitely rubs the wrong way. It will work for very "simple" arguments but it must be enclosed in quotes to handle arguments with space characters. Often even triple quotes (x="""$p$""" or x='''$p$'''), to be able to handle arguments with quotes in them. This is not the same with <<__p__>> which is enclosed already. (Insufficient) references: Macro Calls in WikiText <https://tiddlywiki.com/prerelease/#Macro%20Calls%20in%20WikiText> Macro Definitions in WikiText <https://tiddlywiki.com/prerelease/#Macro%20Definitions%20in%20WikiText> <:-) On Tuesday, March 2, 2021 at 11:58:52 PM UTC+1 Mat wrote: > WOW! To say the least. (And incidentally I'm working on a distantly > related thing). > > Regarding your problems here are some first guesses: > > >regexp="([A-Z]+(?=[0-9]+))|([0-9]+(?=[A-Z]+))" > >and filter="[<ref>splitregexp<regexp>reverse[]]" > > Maybe you need to escape the square brackets? > > ><<mymacro one/2/three>> fails. I > > See if enclosing the argument with "..." helps > > ><$set filter:"filter" variable="var"> and <$vars var={{{ filter }}}> give > dif > > Again some syntactic tidbits (but maybe you just mistyped in this post): > > <$set filter*=*"filter" name="var"> > > > <:-) > > > > 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/c00a7db2-c0ef-490e-9b1b-74af63099db6n%40googlegroups.com.

