Hi,
the idea is nice, but (and this is my very private opinion) it has one
problem. It hides the context of the SWITCH statement. An example:
In C you have something like:
...
sel = computeYourSelector();
switch (sel) {
case 1: ...
case 2: ...
default: ...
}
...
One sees instantly, there are two cases and, if the individual blocks
are short, you see the whole case statement.
Your version is just one line:
...
set sel=$$computeYourSelector()
do @$get(Goto(sel),"ELSE")
...
I miss the context! Which are the possible selectors (i.e. the possible
values for *sel*? Even I don't know, where to look for a specific
selector block. The content of Goto(sel) could be any label in the
current routine or worse, in another routine.
You suggested, the selector-array should be set "in the initialization".
Merely, this could be in the current routine or somewhere else, far far
away from the "current switch statement, I'm struggling with".
Even worse, somewhere could be a dynamic change to your goto() array.
In the init you do:
set Goto(1)="ONE"
then later (possibly at a hidden place):
set Goto(1)="MYONE"
At least, I hope your selector-array will have a suitable name like
orderType() and not just a do() or goto().
On the other hand, with just one line of code, you can have a multilevel
CASE statemant, like
...
set s1=...
set s2=...
do @$g(myFlow(s1,s2,...,sN),$g(defFlow(s1,s2,...,s<N-1>,"genDEFAULT"))
...
There is one thing, I do not understand. In some kind, every
(programing) language is evolving except M (and except the ISC version).
Why? It seems, some people are proud to say, "I adhere to version
<put_in_here_youre_loved_version>" but nobody says, hey, give us
something new, for example a SWITCH command, block structures, TRY-CATCH
and many other things.
Regards,
Julius
--
An old Windows has old security holes.
A new Windows has new security holes.
Another OS has other security holes.
For safety you must care yourself.