home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / rexx / 896 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  2.9 KB

  1. Path: sparky!uunet!decwrl!contessa!mwm
  2. From: mwm@contessa.palo-alto.ca.us (Mike Meyer)
  3. Subject: Re: Blanks, REXX, and portability...
  4. Newsgroups: comp.lang.rexx
  5. Distribution: world
  6. References: <9208270054.AA19196@SERVER.uwindsor.ca> <ANDERS.92Aug27063035@lise3.lise.unit.no> <1992Aug27.175521.1@sejnet.sunet.se>
  7. X-NewsSoftware: Amiga Yarn 3.4, 1992/08/12 15:49:52
  8. Keywords: 
  9. Summary: 
  10. Message-ID: <mwm.1pdx@contessa.palo-alto.ca.us>
  11. Date: 30 Aug 92 16:35:41 PST
  12. Organization: Missionaria Phonibalonica
  13. Lines: 47
  14.  
  15. In <1992Aug27.175521.1@sejnet.sunet.se>, eric@sejnet.sunet.se (Eric Thomas) wrote:
  16. > Ok, time for the usual stupid question. Say I have a program that does:
  17. >                   Parse var line ':'tagname'.'value' :'line
  18. > Say I run that program on an ASCII system which recognize the 20-odd types of
  19. > blanks Otto showed in his posting. Where does my 'value' variable end, when the
  20. > interpreter encounters a SPACE followed by colon (ancient, despicable, evil
  21. > EBCDIC-type behaviour, surely that must not be the case), or also when it
  22. > encounters TAB followed by colon (nice, modern ASCII-type behaviour which
  23. > happens to break the program because that is not what the programmer wanted
  24. > and thought the interpreter would do).
  25.  
  26. What you want it to be is whatever whoever generated the input thought
  27. it would be. In the case that I run into most, that's easy.  I'm
  28. dealing with data that follows Internet Request For Comment #822,
  29. which says:
  30.  
  31.      3.4.2.  WHITE SPACE
  32.  
  33.         Note:  In structured field bodies, multiple linear space ASCII
  34.                characters  (namely  HTABs  and  SPACEs) are treated as
  35.                single spaces and may freely surround any  symbol.   In
  36.                all header fields, the only place in which at least one
  37.                LWSP-char is REQUIRED is at the beginning of  continua-
  38.                tion lines in a folded field.
  39.  
  40. I.e. - I have to accept both space and tab as space, because the
  41. standards document I'm using _says_ I do.
  42.  
  43. > In either case you have a problem. If the blank in the search string only
  44. > stands for SPACE, it is very difficult to indicate that you want any of the 20+
  45. > white space characters to match. You would almost need a new WSPARSE command,
  46. > and WSPOS, and so on. If on the other hand the blank stands for any white space
  47. > character, you have no way in the language to halt on just a SPACE when you
  48. > need to do that. OPTIONS is not a solution, a given program may well need both
  49. > functions very often and switching OPTIONS statements is at best impractical.
  50.  
  51. How many cases have you run into that need both behaviors (nuts, how
  52. many have you run into other than the one you normally deal with)? The
  53. only ones I've met were that way because the input data stream allowed
  54. used TABs as whitespace, but the output streams didn't. That case
  55. doesn't require changing modes in midstream, it just means you can't
  56. generate TABs. No problem.
  57.  
  58.     <mike
  59.  
  60.