On further reflection, the conditional expression cannot be merged with a
simple redefinition. The conditional expressions have the "shortcut"
feature where not all of the expressions need to be evaluated. The
conditionals will still need to be a special case because of that.
Also on further reflection .. perhaps the conditional case could drop the
shortcut feature. In other words: all the expressions are evaluated, and
if any of them are true then the THEN/WHEN path is taken.
No, we can't do that. The whole point of that feature was to allow for the
shortcut to happen! This allows for tests like
if a~isa(.String), a~length > 0 then
to work. This instruction would give an error if all of the expressions are
evaluated because the second test is only value if the first test is true.
Making that change would break every single program I've written that uses
that construct since I only use that sort of conditional because of the
shortcut behaviour.
Understood ... shortcut mechanism is good. What I'm suggesting is that my
choice of using commas to indicate that behavior could perhaps be improved
upon, especially given the recent discussion.
Or, more generally ... some way to apply shortcuts in all expressions, not
just in the IF/WHEN special case.
I don't think ooRexx needs to follow NetRexx in this .. hindsight has value.
ooRexx has already followed NetRexx in this and even gone a little beyond in
adding this also to while and until loop conditions. I don't see how
shortcutting would have any meaning in the other places where we'd wish to
generate lists of items. All of the expressions really need to be evaluated
in those situations to generate the array. The list usage in conditionals
really is quite a different construct. In addition to the shortcut
evaluation, they also do not allow omitted expressions, which work just fine
in the other contexts (e.g., argument lists).
I don't really see much value into trying to force-fit these together. It's
not really necessary to have everything work out.
I guess I wasn't explicit enough. I was thinking that using commas for the
'short cut' case was short sighted, and maybe a different syntax for that
would be better. So the comma notation would always be 'evaluate them all'
and something different would be 'this is a sequence of logical tests that
can be short-circuited'. (Consider & vs. && in C.)
Commas might indeed be the best, here, but worth exploring alternatives,
briefly at least?
Mike
------------------------------------------------------------------------------
Slashdot TV. Video for Nerds. Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel