Replies: 5 comments 9 replies
-
Hi @pmario that is a good point. Are there any existing core functions that should be updated to use this convention? We don't consistently use the |
Beta Was this translation helpful? Give feedback.
-
There is one more thing, that I would like to discuss. "Macro private variables that are derived from prameters".
See the Especially So the suggestion is to use
|
Beta Was this translation helpful? Give feedback.
-
Related to a comment from @saqimtiaz at: #8579 (comment) I think the minimum requirement for every function in the core code is a dot. eg I personally think that So for consistency reasons I would prefer if we use the |
Beta Was this translation helpful? Give feedback.
-
I also think, that the topic about "pocedure local variables" is an important one, where we need a decision. see: #7955 (comment) BTW -- It is not possible to use double-underscore because it causes problems with the syntax-highlighter in VSCode. New Proposal: Use |
Beta Was this translation helpful? Give feedback.
-
I completely concur that every function should have a dot in its name name. However, this of itself makes function names very recognizable when reading code without need for a disambiguating prefix. With the introduction of functions we have the opportunity to write code that is far more semantic and expressive, and most of that benefit is lost with the use of a If we are going to use such a prefix, I suggest we only do so for global variables or in templates where the variable namespace for user content is being polluted. This will also necessitate more care from core developers in terms of understanding which variables are being exposed to end users, which is a good thing, as such variables are also an affordance for customization by end users which needs to be maintained for backwards compatibility. |
Beta Was this translation helpful? Give feedback.
-
While completely updating the core toc-macros using procedures, functions and the conditional
<% if %>
instead of the reveal-widget, I found out that TW core function should get a new prefix.eg: I'm using
\function tf.toc-stateTitle() ...
as a "base" function to build qualified state-tiddlers for open/close statesUsing it in code like so
<$qualify name="toc-state" title=<<tf.toc-stateTitle>>>
it makes it immediately clear, thattf.xx
is defined as a\function
. -- Using thetf<dot>
also makes it possible, that the functions can be used as filter operators, if needed.So IMO it's a win-win-win-win. Users can easily identify functions in the code. We can use them with the filter syntax. We we can avoid naming-clashes with user functions and we can test them in the $:/AdvancedSearch -> Filters tab
ATM the naming convention for the toc-macros is
tf.toc-<somethingUseful>
-- I think this should completely avoid naming collisions@Jermolene -- What do you think about a new core prefix
tf.
for core functionBeta Was this translation helpful? Give feedback.
All reactions