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

  1. Newsgroups: comp.lang.rexx
  2. Path: sparky!uunet!usc!news.bbn.com!noc.near.net!ns.draper.com!news.draper.com!MVS.draper.com!SEB1525
  3. From: SEB1525@MVS.draper.com (Steve Bacher)
  4. Subject: Re: PARSE wishlist/brainstorming
  5. Message-ID: <19920827084628SEB1525@MVS.draper.com>
  6. Sender: MVS NNTP News Reader <NNMVS@MVS.draper.com>
  7. Nntp-Posting-Host: mvs.draper.com
  8. Organization: Draper Laboratory
  9. References: <1992Aug24.193441.9572@hou.amoco.com>
  10. Date: Thu, 27 Aug 1992 13:46:00 GMT
  11. Lines: 47
  12.  
  13. In article <1992Aug24.193441.9572@hou.amoco.com>,
  14. zjlc12@hou.amoco.com (Jerry Campbell) writes:
  15.  
  16. >I may retract my original idea.  Perhaps some new parsing template elements?
  17. >
  18. >        Parse Var stream With Stem "fruits:"  nuts.(iterative_stem_template)
  19. >
  20. >Where iterative template could contain strings that would mean, iterate on the
  21. >stem when this string is encountered.  Or numbers which would be somewhat similar
  22. >to the existing N or +N elements.  Only N means start at stem index N and
  23. >+N means iterate over the stem N times.
  24. >
  25. >        stream = "fruit:  apple, orange, plums, banana" ,
  26. >                 "nuts:   walnut, almond, filbert"
  27. >
  28. >        Parse Var stream With Stem "fruit:" fruits.("," 1 +2) ,
  29. >                                   "nuts:"  nuts.("," 1 +2)
  30. >
  31. >This would retain a certain amount of symmetry with the existing parsing elements
  32. >which is, to my mind, a good thing.  And at the same time not collide with
  33. >the normal parsing stuff.  OOOOh it also means we can dump the proposed STEM
  34. >keyword!  Even cleaner yet!
  35. >
  36. >        Parse Var stream "stream_positioner" n stem.(stem template) +n
  37. >                         ^^^^^^^^^^^^^^^^^^^^^                      ^^
  38. >                         (regular parsing stuff)
  39. >
  40. >        Parse Var stream "stream_positioner" n stem.(stem template) +n
  41. >                                               ^^^^^^^^^^^^^^^^^^^^
  42. >                                               (new parsing stuff)
  43. >What do you think?  More workable?  How tough is this syntax to interpret?
  44.  
  45. I think this is getting awfully complex (I hear creatures feeping).
  46. Not as crufty as Lisp FORMAT yet, but getting close.  One advantage
  47. of REXX is its readability - this strains it somewhat.
  48.  
  49. I'd probably prefer to do it in multiple stages:
  50.  
  51.    Parse Var stream    "fruit:"  fruitlist "nuts:" nutlist
  52.    Parse Var fruitlist  Stem "," fruit.
  53.    Parse Var nutlist    Stem "," nut.
  54.  
  55. Looks pretty clear to me that way.
  56.  
  57. --
  58. Steve Bacher (Batchman)                 Draper Laboratory
  59. Internet: seb@draper.com                Cambridge, MA, USA
  60.