Hi Mark,
thank you for your answer, it's not exactly what I was looking for
(I would rather avoid using a tiddler to store the value), but it
got me thinking again and I found the solution!
Basically it consists in using a macro with a default value for a
parameter, and using the macrocall widget (otherwise an undefined
variable is interpreted as the empty string apparently). Here it is:
\define default-if-empty(v:"default") $v$
! version 1: param has a value
<$set name=param value="my-value">
<$macrocall $name="default-if-empty" v=<<param>>
/>
</$set>
! version 2: param is undefined
<$macrocall $name="default-if-empty" v=<<param>>
/>
This is probably what Mat was referring to in his answer yesterday,
somehow it hit my brain only now :-)
If anyone is interested, the problem which got me thinking about
that is explained here:
https://github.com/Jermolene/TiddlyWiki5/issues/2044
Thank you all!
Erwan