On Fri, Sep 19, 2014 at 4:51 AM, Mike Cowlishaw <[email protected]> wrote:

>
>
>  I think these do need to be bracketed, since the "," is already used in
> the IF/WHEN instruction and with DO WHILE/UNTIL for the shortcut AND
> conditionals.
>
> Ah, but can one not think of those lists as arrays?   And maybe even
> define them that way.
>
> That might work, but currently those lists get some special treatment.  If
you redefined the conditional expression such that it needs to evaluate to
a Rexx boolean OR an array where each element must evaluate to a boolean,
this will work.  That means something like this

conds = .array~of(.true, .true, .true)

if conds then

would be equivalent to

if .true, .true, .true then

but that does make the comma form less of a special expression case.

There's a little awkwardness if you are using these within an argument list
since you'd need to use parens.  Thus my example of a collection OF method
would need to be coded

dir = .directory~of(("Rick", "USA"), ("Mike", "UK"))

you'd still need bracketing, just using parens rather than brackets.  This
becomes more of a documentation issue since it will be important to
highlight this point, but not that big of a deal.

I think I'm starting to warm up to this suggestion.  This just expands on
something we already have and still leaves the brackets available for some
other future usage.

Rick


>
> Square brackets are already used as a message type (primarily with
> collection objects), but thankfully, the usage follows the same rules as
> builtin functions, so they can be used in both the message form and
> paren-like fashion.
>
> (Yes, I use them heavily with stems passed to routines and accessed via
> Use Arg.)
>
>  Doubling up might work, but it feels somehow "not right" to me.
>
>  I agree -- ugly, too.
>
> Mike
>
>  -------------------
>
>
> On Thu, Sep 18, 2014 at 12:49 PM, Mike Cowlishaw <[email protected]>
> wrote:
>
>>  If one didn't want to use up the 'gold' of single brackets  ...
>>
>>
>> first, does one need the brackets at all?  I've often thought as commas
>> in Rexx as being a list notation, in effect, so perhaps:
>>
>>   a=1, 2, 3
>>
>> or
>>
>>   do x over 23, 34, 45
>>
>> Or, to save single-square-brackets one could go Wikipedia-like:
>>
>>   a=[[1, 2, 3]]
>>
>> etc ...
>>
>> 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
>>
>>
>
>
> ------------------------------------------------------------------------------
> 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
>
>
------------------------------------------------------------------------------
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

Reply via email to