Re: [tw5] Re: [good practice] A multi steps IF using filters

2021-01-24 Thread Mohammad Rahmani
Thank you @Mark. It seems the {{{filter...}}} has a lot of potential to create conditional statements. The actual use case was based on the user interaction a set of classes shall be applied to few html tags. I used the dictionary tiddler, but for small use cases I like your approach. @Tones,

Re: [tw5] Re: [good practice] A multi steps IF using filters

2021-01-24 Thread TW Tones
Mohammad, I know your example is more a general example, but if we look at the specific example translating a number to a number-word we have the advantage that the input is an integer. \define number-words() one two three four five six seven eight nine <$list filter="[range[1,9]]"> <> {{{

Re: [tw5] Re: [good practice] A multi steps IF using filters

2021-01-24 Thread Mohammad Rahmani
Mat, Thank you! Well yes a dictionary tiddler can be used. I have used such a solution in my recent plugin Tamasha. I also implement the switch-case using your proposed solution. Really powerful. By the way, there are situations where the operands are not constant. I just tried to see how I can

Re: [tw5] Re: [good practice] A multi steps IF using filters

2021-01-24 Thread Mohammad Rahmani
Thank you Jed, I have not used the lookup operator, seems promising. I will give a try. Best wishes Mohammad On Sun, Jan 24, 2021 at 2:41 PM Jed Carty wrote: > I don't see anything wrong with using that macro, but I do have an > alternative that I think is more flexible. > Depending on the