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

  1. Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!imc
  2. From: imc@comlab.ox.ac.uk (Ian Collier)
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re: Blanks, REXX, and portability...
  5. Message-ID: <2413.imc@uk.ac.ox.prg>
  6. Date: 8 Sep 92 15:49:09 GMT
  7. References: <REXXLIST%92090701303986@UGA.CC.UGA.EDU> <MARTINC.92Sep7104222@grover.cs.unc.edu> <1966@coyote.UUCP>
  8. Organization: Oxford University Computing Laboratory, UK
  9. Lines: 48
  10. X-Local-Date: Tuesday, 8th September 1992 at 4:48pm BST
  11. Originator: imc@msc2.comlab
  12.  
  13. In article <1966@coyote.UUCP>, drake@drake.almaden.ibm.com (Sam Drake) wrote:
  14. >Excuse me, I'm late to this debate, and frankly the discussion here is
  15. >seriously in the ditch.
  16.  
  17. Yes, I've joined this argument halfway through as well, and have already
  18. read rather a lot of repetitive articles on the subject.  However, here I go
  19. as well...
  20.  
  21. I have an interest in this subject (and several other threads too), since -
  22. as you may know - I just released a Unix Rexx version in which the only
  23. whitespace character is '20'x (except that unquoted tabs count as whitespace
  24. when reading in the Rexx source).  While I can see that having PARSE and
  25. WORDPOS treat spaces and tabs identically can have its advantages, I would
  26. much rather leave the language unchanged except for a new builtin function
  27. expand() which expands tabs into spaces (however if there really is demand
  28. for a "PARSE EXPAND <source> <pattern>", having identical meaning to
  29. "PARSE VALUE expand(<source>) WITH <pattern>" then I would reluctantly put
  30. it in).
  31.  
  32. The following question raises a worry about having PARSE treat tabs as
  33. spaces by default:
  34.  
  35. >Can someone, calmly, explain for my own edification what's wrong with:
  36. [the following by martinc@grover.cs.unc.edu (Charles R. Martin)]
  37. >>line='foo     bar     bletch' /* that's <space><tab> */
  38. >>parse var line a b c
  39. >>
  40. >>it makes sense to have a='foo', b='bar', and c='bletch', and to have
  41. >>parse eat both whitespace characters just as it already eats any string
  42. >>of blanks between non-blank maximals.  
  43.  
  44. Firstly, PARSE eats only one whitespace character from the last token (i.e.
  45. that assigned to c in the example) - so c would contain at least one
  46. whitespace character after the above parse.
  47.  
  48. Secondly, if PARSE is supposed to eat exactly one space, what happens if a
  49. tab separates the penultimate token from the last one?  Does it eat the
  50. whole tab, or eat one space from the tab and leave seven still there?
  51.  
  52. A different point is this: the meaning of "parse value expand(a) with c 15 d"
  53. is clear, but what would "parse var a c 15 d" do if a contains tabs, and
  54. tabs are special to the parse instruction?  Something that starts in column
  55. 15 will not necessarily start with the 15th character: in "\t12345678", the
  56. string "78" starts in column 15, but "7" is only the eighth character.  Is
  57. parse allowed to split up a tab character if it spans columns 9-16?
  58.  
  59. Ian Collier
  60. Ian.Collier@prg.ox.ac.uk | imc@ecs.ox.ac.uk
  61.