IMO “less friendly” is in the eye of the beholder. The compare-operator is very verbose, which makes it easy to understand. You are right, it also makes it a bit “bulky” to type.
On the other hand, since TW v5.3.0 (July 2023) we can define our own filter functions. So if we know, that we get string inputs, we could define a function like eg: f.lteg[5]
\function f.lteq(nr) [length[]compare:number:lteq<nr>]
{{{ [[ab cd]f.lteq[5]] }}}
- The advantage of this higher level filter is compactness.
- The disadvantage is, that it trades verbosity for compactness.
- It abstracts away the verbosity or “bulkyness” of the compare-operator. So it increases the level of abstraction
All of this is perfectly fine, if it is done in a consistent way, within the realm of the specific use-case.
For this specific usecase we turn the number of characters of an input into a number and we compare it to a dynamic value.
- The higher level of abstraction increases mental complexity.
- The increased complexity has to be documented, so users can understand the new function.
Most of the time the TW core prefers verbosity and focuses on 1 functionality, which can be “splitted” up into smaller “simple” pieces.
So “simple” building blocks can be used to create more powerful and more abstract functions.
As I wrote. These custom functions most of the time are very specific to a certain usecase.
For the core we try to be as generic as possible and to keep it “simple”. There should be only one way to solve a specific problem.
Conclusion
I think we should explore the possibilities we have.
Creating custom filter functions is a relatively “new art” in TiddlyWiki and we only start to understand the possibilities they give us.
The big advantage is, that it can be done by every user out of the box.
If we would change the behaviour of the length[]
operator to length[x]
, we would “mimic” length[]match[x]
If we implement length[min],[max]
from the second comment we would mimic a limited version of the the compare-operators
Most importantly, we would need to modify the core and we do not even know, if that covers all the possible use-cases.
just my thoughts
-mario