home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / rexx / 838 < prev    next >
Encoding:
Text File  |  1992-08-30  |  3.0 KB  |  72 lines

  1. Newsgroups: comp.lang.rexx
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!ugle!anders
  3. From: anders@lise3.lise.unit.no (Anders Christensen)
  4. Subject: Re: Eric's question
  5. In-Reply-To: eric@sejnet.sunet.se's message of Sat, 29 Aug 1992 23:36:31 GMT
  6. Message-ID: <ANDERS.92Aug30131227@lise3.lise.unit.no>
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Organization: University of Trondheim, Norway
  9. References: <ANDERS.92Aug29050537@lise3.lise.unit.no> <1992Aug29.163731.1@sejnet.sunet.se>
  10.     <ANDERS.92Aug29194248@lise3.lise.unit.no>
  11.     <1992Aug29.233631.1@sejnet.sunet.se>
  12. Date: 30 Aug 92 13:12:27
  13. Lines: 57
  14.  
  15. In article <1992Aug29.233631.1@sejnet.sunet.se> eric@sejnet.sunet.se (Eric Thomas) writes:
  16. > In article <ANDERS.92Aug29194248@lise3.lise.unit.no>, anders@lise3.lise.unit.no (Anders Christensen) writes:
  17. > >>             Parse var data a b . ' A('c')' d
  18. > > 
  19. > > You use a Space character in the pattern to denote a whitespace.
  20.  
  21. > [Misinterpretation of above statement deleted]
  22.  
  23. This was _not_ a suggested solution. It was a statement about your
  24. programming style in that clause.
  25.  
  26. > What a pathetic conclusion - "if you can't do it, it means you 
  27. > shouldn't do it this way, and not that something is wrong". 
  28.  
  29. Is this meant as a sort of quote from my posting?
  30.  
  31. In a parse clause:
  32.  
  33.   1) If you use a Space in a literal pattern, it should match a Space.
  34.  
  35.   2) If you use a Tab in a literal pattern, it should match a Tab
  36.  
  37.   3) If you want to make a character in a literal pattern to match a
  38.      class of characters, then Rexx is not able to do that in one
  39.      parse clause.
  40.  
  41. If your solution to case 3 is "you should not need to do that", then
  42. let me remind you that you brought the question up in the first place. 
  43.  
  44. Let me explain it again (yes, I will try to be brief):
  45.  
  46.   1) Parsing with a literal pattern containing a Space character, is
  47.      not the same as parsing words delimited by whitespace into
  48.      variables and placeholders.
  49.  
  50.      The latter will (normally) match a non-empty, non-leading series
  51.      of 'blanks', with one 'word-delimiter' in the template. Suppose
  52.      your operating system normally considers words to be separated by
  53.      not one single character, but any from a class of characters.
  54.      Then it seems natural to me that implementations of Rexx under
  55.      that operating system should recognize all characters in that
  56.      class as possible word-delimiting whitespace.
  57.  
  58.      The former will seek for a particular character, never for a
  59.      class of characters. This is because Rexx does not have a way
  60.      of specifying a pattern containing characters belonging to a
  61.      character class, only single characters.
  62.  
  63.   2) You can solve this by adding regexps. But that might not be wise
  64.      since it also adds a lot of complexity. If you want to leave
  65.      regexps (and other extensions) out of it, then you have to write
  66.      more than one parse clause to do it.
  67.  
  68.   3) As far as I can remember, nobody has suggested that Space and Tab
  69.      should be synonymous in the tails of compound variables. 
  70.  
  71. -anders
  72.