home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!sejnet.sunet.se!eric
- From: eric@sejnet.sunet.se (Eric Thomas)
- Newsgroups: comp.lang.rexx
- Subject: Re: do over stem
- Message-ID: <1992Aug26.030344.1@sejnet.sunet.se>
- Date: 26 Aug 92 03:03:44 GMT
- References: <179f67INNkfm@stanley.cis.Brown.EDU> <ANDERS.92Aug25001604@lise3.lise.unit.no> <1684D13F6B.PNNTEST@pucc.Princeton.EDU>
- Sender: news@sunic.sunet.se
- Reply-To: ERIC@SEARN.SUNET.SE
- Organization: SUNET, Stockholm, Sweden
- Lines: 27
-
- In article <1684D13F6B.PNNTEST@pucc.Princeton.EDU>, tdtrue@pucc.Princeton.EDU writes:
- > In article <ANDERS.92Aug25001604@lise3.lise.unit.no>
- > anders@lise3.lise.unit.no (Anders Christensen) writes:
- >>Unfortunately, a builtin function called tails(), which takes the name
- >>of a stem as parameter, and return a list of tails, is impossible.
- >>Because tails may include any character, there is no character left
- >>that can be used as separator for the various tails.
- >
- > Another approach to this would be to have tails() return only one
- > tail at a time. You would then need some sort of 'SET/RESET'
- > parameter with tail() as well. When no more tails are available, it
- > would return null ... or can null be a tail as well?
-
- Null can be a tail. Your tail() either needs to remember all sorts of things
- internally between each call, or needs to be given the name of the last tail it
- returned so that it can find the next one. The latter case opens up a nice can
- of worm in case of incorrect input, dropped variable, and performance would be
- worse since it has to locate the input tail every time. No good. In the former
- case, tail() has to store this internal data somewhere and has to make sure
- that the memory in question is released if you exit prematurely (without a
- RESET call), or whatever you wanted to call it. No good. Or the data can be in
- internal interpreter work areas, like the stem descriptor, in which case it
- might as well be done directly by the interpreter with 'Do i over l.' or the
- like. The interpreter furthermore has the ability to prevent drop or additions
- to the stem while it is being examined if that is necessary.
-
- Eric
-