home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!eff!snorkelwacker.mit.edu!bloom-beacon!eru.mt.luth.se!lunic!sunic!aun.uninett.no!ugle.unit.no!ugle!anders
- From: anders@lise3.lise.unit.no (Anders Christensen)
- Newsgroups: comp.lang.rexx
- Subject: Re: do over stem
- Message-ID: <ANDERS.92Aug26061644@lise3.lise.unit.no>
- Date: 26 Aug 92 04:16:44 GMT
- References: <179f67INNkfm@stanley.cis.Brown.EDU> <ANDERS.92Aug25001604@lise3.lise.unit.no>
- <1992Aug26.025338.1@sejnet.sunet.se>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: /home/flipper/anders/.organization
- Lines: 58
- In-Reply-To: eric@sejnet.sunet.se's message of Wed, 26 Aug 1992 02:53:38 GMT
-
- In article <1992Aug26.025338.1@sejnet.sunet.se> eric@sejnet.sunet.se (Eric Thomas) writes:
-
- > [about the 'do i over stem.' construct]
-
- I don't think there is really any technical problems with implementing
- such a construct, either function-based or as part of 'do'. Some
- problems have already been pointed out, but none so big that is
- impossible to do.
-
- My main objection is not technical, but "Does it belong in Rexx?"
-
- Eric Thomas posted some pieces of code, which could have been
- simplyfied a lot if a 'do i over stem' existed, and I agree that there
- is a need for such a construct. But the question is rather, "Does the
- need justify adding the feature to the definition of Rexx?".
-
- For every new feature in Rexx, the definition of the language
- increases, and the language becomes more complicated for new users to
- learn. For those who already know Rexx well (includes most of the
- readers of this group), the addition of a simple feature might not be
- a big deal. But for language itself, the accumulation of many simple
- features can make Rexx big, complex and difficult to learn for new
- users.
-
- As for the construct itself, I like the 'do foo over bar.' best, since
- all the function-based solutions I have seem looks like some sort of
- kludge to me.
-
- What about letting 'var over stem." be an alternative 'repetitor' in
- do clauses. Then it would be possible to do something like:
-
- do <var> over <stem.> { while <exprw> | until <expru> }
-
- then <var> would be the control variable, which could be given as
- arguement to 'leave' and 'iterate', or be put after 'end'. Perhaps the
- 'for <exprf>' should be allowed in the repetitor too? I'm not so sure,
- it is just a random thought. Anyway, the only change in the old syntax
- would be to have 'OVER' be a reserved word in the repetitor.
-
- It would work something like: <var> is 'iterated through' the tails
- which the stem <stem.> had at the moment when the do-loop was entered.
- At each iteration, <var> is set to the name of a new tail. If <var>
- is a compound with stem <stem.> it is not included in the list of
- stems to be iterated over, unless it was already set before the
- do-loop. The 'until' part is checked at the end of each iteration,
- before <var> is incremented. The 'while' is checked at the start of
- each iteration after <var> is assigned or incremented. The order in
- which the tails are assigned to <var> is arbitrary. Any setting or
- dropping of compounds with stem <stem.> during the loop, has no effect
- on the looping.
-
- Is this more or less the functionality you wanted?
-
- > Now it's too late, I am moving away from REXX as fast as I can.
-
- I'm sorry to hear that.
-
- -anders
-