I've started coding this up, and the "," syntax for list creation looks
very doable. The meaning of the "," depends on the context, as already
noted, but the contexts are absolutely unambiguous so it is always possible
to assign the correct meaning.
However, I want to circle back around to the discussion of the
short-circuited AND. We can't eliminate the usage on IF/WHEN, etc., but on
the other hand, there are certainly contexts where an and operator that
uses short-circuit logic might be useful. One could argue that an OR
version could also be useful. I don't believe this is possible for XOR,
since the result always depends on both values. Are there any operator
combinations that would make sense? Doubling up obviously doesn't work
because && and || are already operators.
Rick
On Sat, Sep 20, 2014 at 10:41 AM, Mike Cowlishaw <[email protected]>
wrote:
>
>
>
> 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
>
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel