On Sun, 9 Mar 2025, at 10:39, Rony G. Flatscher wrote:
> 1) ad stem arrays
> ==============
>
> Stem arrays have been conceived and used since the inception of Rexx.
>
> The pattern is simple: the tail is an integer number from 1 on, the 
> tail with the value 0 keeps the 
> current number of total stem array elements. E.g.:
>
>     a.1="one"
>     a.2="two"
>     a.0=2     
>     say "there are" a.0 "items"
>
> Turning such a stem array into an ooRexx array should yield an array 
> that omits the element with the 
> tail 0 and uses the tail's number as index in the ooRexx array. E.g. 
> turning the above stem array 
> into an ooRexx array:
>
>     a[1]="one"
>     a[2]="two"
>     say "there are" a~itmes "items"
>
> 1a) In order to create an ooRexx array from a stem array the following 
> method should be added to the 
> stem class:
>
>     makeArrayFromStemArray

Should the method (optionally?) check that that the stem array didn't have
any elements with tails not meeting the only-incrementing-integers rule?

For example, if one has

   a.1="one"
   a.2="two"
   a.3="what about this?"
   a.0=2
   a.0.1 = "something else"
   a.0.2 = "and this"

would it work (create a 2-element array) but ignore a.3 and the extra a.0.n
elements?


Should there also be an option to drop either the whole original stem, or
perhaps just the elements that ended up in the array?

-- 
Jeremy Nicoll - my opinions are my own.


_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to