Hmm, how about the following idea: allow a multiReturn assignment indirectly 
with a new variant of
"PARSE" keyword statement, e.g.  "PARSE ARRAY ..."?

This way, in ooRexx 5.0 one can return an array which than can be used to 
assign its elements to
different variables. Something like:

    /* assign elements of an array to variables */
    PARSE ARRAY test() one two . four 1 st.1 st.2 . st.3 .

    say "one: " one  "two: " two  "four:" four
    say "st.1:" st.1 "st.2:" st.2 "st.4:" st.4

    ::routine test
      return ("eins", "due", "troi", "four", "pet") -- multi return

This would yield:

    one:  eins two:  due four: four
    st.1: eins st.2: due st.4: four

I would suggest to intentionally keep this restricted to array objects, such 
that no idiosyncracies
can occur. It is up to the programmer to create the appropriate array object 
which is very easy
(e.g. using makearray, allindexes, allitems and the like). Absolute and 
relative numbers could be
supported carrying forward those abilities from other PARSE keyword statements.

This array variant of PARSE would fit very well into the existing applications 
of PARSE (I remember
to learn from Les Koehler how to initialize multiple variables in a single 
statement using the PARSE
statement).

What do you think?

---rony



On 11.08.2018 21:42, Rick McGuire wrote:
> The whole concept of it. There were just too many holes that kept popping up 
> that made it largely
> undefinable. 
>
> Rick
>
> On Sat, Aug 11, 2018 at 3:38 PM Erich Steinböck <erich.steinbo...@gmail.com
> <mailto:erich.steinbo...@gmail.com>> wrote:
>
>     Rick, what was it that wouldn't work for a multi-return feature?
>
>     On Sat, Aug 11, 2018 at 1:29 AM, bigrixx--- via Oorexx-svn 
> <oorexx-...@lists.sourceforge.net
>     <mailto:oorexx-...@lists.sourceforge.net>> wrote:
>
>         Revision: 11478
>                   http://sourceforge.net/p/oorexx/code-0/11478
>         Author:   bigrixx
>         Date:     2018-08-10 23:29:49 +0000 (Fri, 10 Aug 2018)
>         Log Message:
>         -----------
>         delete sandbox version of idea that did not pan out
>
>         Removed Paths:
>         -------------
>             sandbox/rick/multiReturn/
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to