Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!bacchus!mwm From: mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) Newsgroups: comp.lang.rexx Subject: Re: Iterating on Stems Message-ID: Date: 11 Mar 91 20:00:36 GMT References: <1991Mar9.215906.4976@ssd.kodak.com> Sender: news@pa.dec.com (News) Followup-To: comp.lang.rexx Organization: Missionaria Phonibalonica Lines: 45 In-Reply-To: jeffv@bisco.kodak.com's message of 9 Mar 91 21:59:06 GMT In article <1991Mar9.215906.4976@ssd.kodak.com> jeffv@bisco.kodak.com (Jeff Van Epps) writes: I solved it by storing the keys at the same time as the data, in a more normal array (keys.1 keys.2 keys.3 etc.), with a count of how many keys have been processed so far. But this strikes me as a kludgy workaround for a missing language feature. Does the language feature exist and I just missed it?? That's pretty much the canonical way to do things. When I asked an implementer about this, the answer was: "Because it's not a simple problem". In Perl, it's simple - you have a one dimensional array, and are done with it. In Rexx, you have multi-diminsional arrays. It's not uncommon to do things like, though this is extreme): array.index /* Type information */ array.index.name /* print name */ array.index.function /* Name of function to invoke */ array.index.number /* Numeric value */ array.index.string /* String value */ array.index.multivalue /* Multivalued object. */ array.index.multivalue.1 /* Type for this value */ array.index.multivalue.1.{function,number,string,multivalue} array.index.multivalue.2 etc. So, what would you have a Rexx version of "each(months)" return? The list of values index can take on? That gives you all named objects, but makes dealing with the multi-valued objects somewhat harder. The list of all complete stems? That gives you everything, but requires filtering them after the fact. BTW, if you can come up with a good solution, I believe that people who are on - or have the ear of people who are on - the ANSI Rexx committee are listening in. So it may show up in a later version.