☑ cool new feature
☑ could help many users!
☑ removes something that feels like a „bug“
☐ nice to have
☐ nobody needs it
#myTop10_2024
Short:
Let JSL Editor show which function evaluates it's arguments and which function doesn't!
Long:
What inspired this wish list request?
There is a very powerful behavior in JSL which, on the other hand, makes it difficult for new users to get started without hiccups:
Some Functions evaluate their arguments and others don't.
This is very important for functions which are used for expression handling.
There is a wonderful lecture by @joseph_morgan : Using JSL to Develop Efficient, Robust Applications (EU 2018 415) on the differences, how to live with them and how to use them to develop efficient and robust applications.
... describing the status at that time: Jmp 14 [2018]:
This doesn't exist in the documentation.
This is something I figured out [ ] by reverse engineering the behavior of expression handling functions.
Trust me, [ ] if you do not think of these functions in this you will never get them right.
Besides the expression handling functions listed here, the same holds for all function:
if you do not think of these functions in this you will never get them right:
It's highly important to know if an argument gets evaluated before the function call of not.
Does this code work or doesn't it?!?
dt = Expr(current data table());
myscript = Expr(get script());
dt << myscript
Unfortunately, for the JSL scripter there is no hint how the function behaves - does it evaluate its arguments or not?
Maybe it just evaluates one of the arguments? Who knows?
The user has to know!
... or: reverse engineering the behavior of the respective functions.
What is the improvement you would like to see?
Please implement some syntax highlighting to indicate the different ways a function evaluates - or doesn't evaluate its arguments.
Add-On: Please also indicate the difference in the Scripting index.
In JSL editor, the highlighting can be activated/deactivated via a keyboard shortcut.
The Expr(_x_^2) show kind of dilemma:
the argument of Expr () doesn't get evaluated. But the two arguments of ^ would get evaluated.
Maybe the highlighting reacts on the position of the mouse or cursor - just the arguments below the branch are highlighted where the mouse/cursor is currently located.
Why is this idea important?
With the new syntax highlighting, JMP will guide the user automatically to generate the right code.
The user doesn't have to run the code to get an error message - or to see the wrong result
... or to reverse engineer the function - like @JosephMorgan had to do to prepare his paper.
other wishes from