diff --git a/editions/tw5.com/tiddlers/functions/Functions.tid b/editions/tw5.com/tiddlers/functions/Functions.tid index dadce73a1..028747a34 100644 --- a/editions/tw5.com/tiddlers/functions/Functions.tid +++ b/editions/tw5.com/tiddlers/functions/Functions.tid @@ -1,5 +1,5 @@ created: 20221009124003601 -modified: 20230419103154328 +modified: 20240619211228560 tags: Concepts Reference title: Functions type: text/vnd.tiddlywiki @@ -11,17 +11,17 @@ type: text/vnd.tiddlywiki Functions are usually defined with the [[Pragma: \function]]: ``` -\function my-function(parameter:"2") -[multiply[1.5]] +\function myfun(param:"2") +[multiply[1.5]] \end ``` Functions can be invoked in several ways: -* Directly transclude functions with the syntax `<>` -* Assign functions to widget attributes with the syntax `
>>` -* Invoke functions via the [[function Operator]] with the syntax `[function[myfn],[value],...]` -* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fn[value]]` or `[.myfn[value]]` +* Directly transclude functions with the syntax `<>` +* Assign functions to widget attributes with the syntax `
>>` +* Invoke functions via the [[function Operator]] with the syntax `[function[myfun],[value],...]` +* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fun[value]]` or `[.myfun[value]]` !! How Functions Work diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid index 319bf2c78..98fbf6b28 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid @@ -1,5 +1,5 @@ created: 20230726145210484 -modified: 20230726145757234 +modified: 20240619211734149 tags: [[Variable Usage]] title: Behaviour of invoked variables depends on how the variable was declared type: text/vnd.tiddlywiki @@ -8,19 +8,19 @@ type: text/vnd.tiddlywiki \procedure p1(a1) $a1$ - <<__a1__>> - <> \function f1(a1) "$a1$" "-" [<__a1__>] ="-" [] :and[join[ ]] -Invoked in normal wikitext context: `<$transclude $variable=macro/>` or `<>` +Invoked in normal wikitext context: `<$transclude $variable=myvar/>` or `<>` {{Behaviour of variables invoked via normal wikitext}} -Invoked via widget attribute: `
>/>` +Invoked via widget attribute: `
>/>` {{Behaviour of variables invoked via widget attributes}} -Invoked via filter operator parameter: `[]` +Invoked via filter operator parameter: `[]` {{Behaviour of variables invoked via filter operator parameter}} -Invoked via function call in a filter expression: `[function[macro]]` +Invoked via function call in a filter expression: `[function[.myfun]]` {{Behaviour of variables invoked via filter expression function call}} diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid index 0caa74c26..0eae9acff 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid @@ -1,5 +1,5 @@ created: 20230726142925020 -modified: 20230726150648189 +modified: 20240619211452297 tags: [[Variable Usage]] title: Behaviour of variables invoked via normal wikitext type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|All wikitext and variable substitution and textual substitution takes place| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|All wikitext and variable substitution takes place| -|\function|Invoking a function in this way (`<>`) is a synonym for `<$text text={{{[function[macro]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file +|\function|Invoking a function in this way (`<<.myfun>>`) is a synonym for `<$text text={{{[function[.myfun]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid index 3bf06e219..3784c94e3 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid @@ -1,5 +1,5 @@ created: 20230726143332803 -modified: 20230726150616232 +modified: 20240619210723396 tags: [[Variable Usage]] title: Behaviour of variables invoked via widget attributes type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|Textual substitution of parameters is performed on the body text. No further processing takes place. The result after textual substitution is used as the attribute's value| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|Body text is retrieved as-is and used as the attribute's value.| -|\function|When a function is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file +|\function|When a function (e.g. `.myfun`) is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file