[TWX] some syntactical bits and stuff

199 views
Skip to first unread message

Mat

unread,
Mar 11, 2020, 6:55:52 AM3/11/20
to tiddly...@googlegroups.com
For "TWX", i.e a totally hypothetical future version of TW:

  • Replace $set with an empowered $vars for direct parameter value setting.
  • ...and merge $wikify into it. Wikification can be toggled via a parameter in the widget.
  • Change name of "currentTiddler" variable to be only "current". One reason is because it is not always tiddlers we're talking about. Possibly currentTitle, which as least is closer to what the outputs {{{ from this filter }}} are. (Also, minor, but the "is operator" uses is[current] ) 
  • Only "=" to assign values, not ":". Examples:
<$macrocall $name=italicise text=mytext />
<
<italicise text=mytext >>
\define foo(bar=frotz)
 
...because html tags assign values using = , so it would be consistent. (And currently, it doesn't make sense that it's different symbols when defining a macro parameter default value and when calling that same macro with a parameter value.)
  • Allow "immediate arguments" for some widgets "main attributes". For example 

    <$tiddler tiddler=foo>     ---->  <$tiddler foo>
    <$link to={{!!modifier}}>  ---->  <$link {{!!modifier}}>
    <$view field="modifier"/>  ---->  
    <$view modifier/>

  • Implement a variable call default filter parameter. Saving a list as a variable would then, by default and without having to define a macro, allow you to do e.g <<mylist|[first[]]>> and, something like $(mylist|[first[]])$. This way we can work with full lists in a new way (like arrays) instead of having to work inside a listwidget with one item at a time.

<:-)
 

Mohammad

unread,
Mar 12, 2020, 3:25:01 AM3/12/20
to TiddlyWikiDev


On Wednesday, March 11, 2020 at 2:25:52 PM UTC+3:30, Mat wrote:
For "TWX", i.e a totally hypothetical future version of TW:

  • Replace $set with an empowered $vars for direct parameter value setting.
  • ...and merge $wikify into it. Wikification can be toggled via a parameter in the widget.
  • Change name of "currentTiddler" variable to be only "current". One reason is because it is not always tiddlers we're talking about. Possibly currentTitle, which as least is closer to what the outputs {{{ from this filter }}} are. (Also, minor, but the "is operator" uses is[current] ) 
Now, Tiddlywiki scripting is much more powerful and this is an absolute need! currentTiddler and the concept of tiddler in Tiddlywiki makes confusion. So, currentTiddler is not meaninful anymore for example here <$list filter="[range[1,4]]"> ...

 
  • Only "=" to assign values, not ":". Examples:
<$macrocall $name=italicise text=mytext />
<
<italicise text=mytext >>
\define foo(bar=frotz)
 

I really support this!
 
...because html tags assign values using = , so it would be consistent. (And currently, it doesn't make sense that it's different symbols when defining a macro parameter default value and when calling that same macro with a parameter value.)
  • Allow "immediate arguments" for some widgets. For example the $tiddlerwidget could be called like so
    <$tiddler=foo> or <$tiddler foo>
    ...i.e the string following a separator is assumed to be a value for the "main parameter" of the widget.
  • Implement a variable call default filter parameter. Saving a list as a variable would then, by default and without having to define a macro, allow you to do e.g <<mylist|[first[]]>> and, something like $(mylist|[first[]])$. This way we can work with full lists in a new way (like arrays) instead of having to work inside a listwidget with one item at a time.

    <:-)
     

    Mat

    unread,
    Apr 12, 2020, 8:23:53 PM4/12/20
    to TiddlyWikiDev
    • Change name of "currentTiddler" variable to be only "current". One reason is because it is not always tiddlers we're talking about. Possibly currentTitle, which as least is closer to what the outputs {{{ from this filter }}} are. (Also, minor, but the "is operator" uses is[current] ) 

    • Further, change the name for the TiddlerWidget into the CurrentWidget. 
    <:-)

    Mat

    unread,
    Apr 21, 2020, 9:15:41 AM4/21/20
    to TiddlyWikiDev
    Both due to the many variants employed and a lack for more easily typed brackets or other enclosing characters in TW, i.e:

    [[...]] <<...>> {{...}} '...' "..." """...""" {{{...}}}
    and in filter variants [...] <...> {...}

    there could instead be a single type but with a "flag" to signify what is intended, e.g:

    [[...]] default, no flag signifies filter
    [v[...]] or [[v|...]] to signify variable
    [t[...]] or [[t|...]] to signify transclusion
    etc

    The equivalent of filter [foo<...>] would be either of

    [foo:v[...]] OR [foo|v[...]] OR [foo[v|...]]

    I believe this would be easier to learn because the letter hints what it is and it opens up for an "unlimited" number of possible further techniques that need new enclosure characters.

    <:-)

    Jed Carty

    unread,
    Apr 21, 2020, 10:05:45 AM4/21/20
    to TiddlyWikiDev
    That syntax would be much much harder for me to use. I am dyslexic and have to rely mostly on the shapes of things, not on individual letters. Doing this would make reading and writing the code take many times longer for me.

    Mat

    unread,
    May 12, 2020, 9:00:03 AM5/12/20
    to tiddly...@googlegroups.com
    Further on syntax for TWX:
    • The syntactic distinction between <$thisWidget/> and <<thisCoreMacro>> is unjustified and confusing for an end user. "So what" if they are different constructs programmatically - as an end user I just "type them" in my text and they do things. The one critical syntactic distinction is that widgets can have opening and closing tags with stuff in between, so an equivalent of a closing tag would have to be invented.
      Note <$/> wouldn't have to be replaced. It could mean to merely embed widgets as macros to give them a UI that harmonizes with any macro, so <$/> could have a more hidden role. 
    <:-)

    Mat

    unread,
    Jul 25, 2020, 11:25:24 AM7/25/20
    to TiddlyWikiDev
    Further sugar for TWX and mind:
    • Let the widget name serve as the "main attribute":
    <$set name=x value=...>   →   <$set=x value=...>
    <$tiddler tiddler=x ...>  →   <$tiddler=x ...>
    <$list filter=...>        →   <$list=...>
    (Not everything has a "main attribute")
    • Filtered transclusion: Replace the syntax {{{[...]}}} with [evaluate[...]] i.e an "evaluate" operator. In case of space separation, use single or triple quotes. This would visually harmonize filtered transclusion with how filters look overall. It would also make "fitered translcusion as argument" look better, e.g <$vars foo="[evaluate[...]]">
    <:-)

    Mat

    unread,
    Jul 25, 2020, 11:27:35 AM7/25/20
    to TiddlyWikiDev
    • Let the widget name serve as the "main attribute":
    Ah, I now note that I already posted very similar thoughts to this bullet.

    <:-)

    Mat

    unread,
    Sep 1, 2020, 7:02:49 AM9/1/20
    to tiddly...@googlegroups.com
    Mat wrote:
    • Filtered transclusion: Replace the syntax {{{[...]}}} with [evaluate[...]] i.e an "evaluate" operator. In case of space separation, use single or triple quotes. This would visually harmonize filtered transclusion with how filters look overall. It would also make "fitered translcusion as argument" look better, e.g <$vars foo="[evaluate[...]]">
    • Alternatively, but not quite as slick: Replace the syntax {{{...}}} with {{ ... }} i.e one braces pair is replaced with space characters. (There is already a silent consensus to use such surrounding space characters in filtered transclusion, presumably for clarity.)

    <:-)
    Reply all
    Reply to author
    Forward
    0 new messages