home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!ugle!anders
- From: anders@lise3.lise.unit.no (Anders Christensen)
- Subject: Re: Eric's question
- In-Reply-To: eric@sejnet.sunet.se's message of Sat, 29 Aug 1992 23:36:31 GMT
- Message-ID: <ANDERS.92Aug30131227@lise3.lise.unit.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: University of Trondheim, Norway
- References: <ANDERS.92Aug29050537@lise3.lise.unit.no> <1992Aug29.163731.1@sejnet.sunet.se>
- <ANDERS.92Aug29194248@lise3.lise.unit.no>
- <1992Aug29.233631.1@sejnet.sunet.se>
- Date: 30 Aug 92 13:12:27
- Lines: 57
-
- In article <1992Aug29.233631.1@sejnet.sunet.se> eric@sejnet.sunet.se (Eric Thomas) writes:
- > In article <ANDERS.92Aug29194248@lise3.lise.unit.no>, anders@lise3.lise.unit.no (Anders Christensen) writes:
- > >> Parse var data a b . ' A('c')' d
- > >
- > > You use a Space character in the pattern to denote a whitespace.
-
- > [Misinterpretation of above statement deleted]
-
- This was _not_ a suggested solution. It was a statement about your
- programming style in that clause.
-
- > What a pathetic conclusion - "if you can't do it, it means you
- > shouldn't do it this way, and not that something is wrong".
-
- Is this meant as a sort of quote from my posting?
-
- In a parse clause:
-
- 1) If you use a Space in a literal pattern, it should match a Space.
-
- 2) If you use a Tab in a literal pattern, it should match a Tab
-
- 3) If you want to make a character in a literal pattern to match a
- class of characters, then Rexx is not able to do that in one
- parse clause.
-
- If your solution to case 3 is "you should not need to do that", then
- let me remind you that you brought the question up in the first place.
-
- Let me explain it again (yes, I will try to be brief):
-
- 1) Parsing with a literal pattern containing a Space character, is
- not the same as parsing words delimited by whitespace into
- variables and placeholders.
-
- The latter will (normally) match a non-empty, non-leading series
- of 'blanks', with one 'word-delimiter' in the template. Suppose
- your operating system normally considers words to be separated by
- not one single character, but any from a class of characters.
- Then it seems natural to me that implementations of Rexx under
- that operating system should recognize all characters in that
- class as possible word-delimiting whitespace.
-
- The former will seek for a particular character, never for a
- class of characters. This is because Rexx does not have a way
- of specifying a pattern containing characters belonging to a
- character class, only single characters.
-
- 2) You can solve this by adding regexps. But that might not be wise
- since it also adds a lot of complexity. If you want to leave
- regexps (and other extensions) out of it, then you have to write
- more than one parse clause to do it.
-
- 3) As far as I can remember, nobody has suggested that Space and Tab
- should be synonymous in the tails of compound variables.
-
- -anders
-