Topic: Ternary Conditionals - If Then Else

How about something like If-Then-Else syntax:

%?( condition ?  true  : false )

%?( %N  ?  Number %N  :  <nothing> )

%?( %N  ?  Number %N  :  0 )


Just an idea i stumbling over while testing.


Example:
File.ext
File1.ext
File2.ext
File3.ext

Expression: %N - %f

Current Result:
- File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext



With If-Then:

Expression: %?( %N  ?  %N - %f  )
Result:
File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext


Expression: %?( %N  ?  %N - %f  : 0 - %f )
Result:
0 - File.ext
1 - File1.ext
2 - File2.ext
3 - File3.ext

Re: Ternary Conditionals - If Then Else

It wouldn't be as easy as it looks but it could be added.
I am not sure if it is really necessary: the current version seems able to solve all the cases that have been reported to me.

From a larger point of view it looks like opening the can of the conversion of Siren's small expression syntax into a programing language.

Re: Ternary Conditionals - If Then Else

OK  big_smile