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

  1. Path: sparky!uunet!sun-barr!olivea!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!apctrc!wsc!mozart!zjlc12
  2. From: zjlc12@hou.amoco.com (Jerry Campbell)
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re:      Re: Blanks, REXX, and portability...
  5. Message-ID: <1992Sep11.190834.16887@hou.amoco.com>
  6. Date: 11 Sep 92 19:08:34 GMT
  7. References: <REXXLIST%92091111123047@DEARN>
  8. Sender: news@hou.amoco.com
  9. Reply-To: zjlc12@hou.amoco.com
  10. Organization: Amoco
  11. Lines: 78
  12.  
  13. In article 92091111123047@DEARN,         Otto Stolz <RZOTTO@DKNKURZ1.BITNET> () writes:
  14. >Every program exploiting word-oriented operations will intrinsically
  15. >give up controll over the exact number of blanks. What is so horrible
  16. >about the idea of extending these operations, reasonably, to cover *all*
  17. >instances of words the programmer would expect in a given environment?
  18. >Nobody has ever proposed to take control away from the programmer!
  19. >Everybody shall be free to apply the operations best suited to his or her
  20. >problem -- even in REXX :-)
  21. >
  22.  
  23. Ok, maybe I screamed wolf when it were only the lambs bleating.  Control over
  24. what constitutes a word delimiter would be a nice thing to have.  Certainly
  25. on a Uni* system.  But let me interject another, but!  And its a small but!
  26. But!  Make sure than I can do things like this:
  27.  
  28.   data = 'one \tabchar two three'
  29.   word2 = Word(data,2)
  30.  
  31. ...and... have word2 equal to the _blank delimited_ tab character 
  32.  
  33. I assume you're proposing, with some as yet unspecified mechanism, to be
  34. able to have the obvious alternate possibility work as well:
  35.  
  36.    data = 'one \tabchar two three' 
  37.    word2 = Word(data,2)
  38.  
  39. ....and... word2 will be equal to the characters 'two'
  40.  
  41. How will you make this possible?  I'm sorry but nobody will ever convince
  42. me to give up the functionality represented by the first code fragment. 
  43. And I certainly won't swallow having a Uni* interpreter behave differently
  44. in this respect than a VM interpreter. 
  45.  
  46. I can't offer an opinion bolstered with the finer principles of language
  47. design.  But! (there's another one) I will stand up for the average
  48. programmer and tell you what I think! 
  49.  
  50. >.............................. and may help to confine the discussion
  51. >to the relevant point, viz. how word-oriented operations should be
  52. >defined (not touching character-oriented operations, at all).
  53. >
  54.  
  55. Ok, thanks for the clarification.  Sorry to be one of the causes 
  56. of a time wasting digression, I wasn't paying close enough attention.
  57.  
  58. Ok, Ok, what's the problem then?  What shall we allow as word delimiters?
  59. And how shall the programmer have control over the interpretation/use of these
  60. delimiters when computing on data?  Easy, generalize the concept of delimiters.
  61. Encourage interpreter writers to provide a set of default characters
  62. which are specific to the environment.  And then add another parameter to all
  63. the word oriented functions by which an alternate set of delimiting characters
  64. may be specified.  For cases such as,  is ' a' = '\wa'   (\w means whitespace)
  65. let the general form of comparator use the implementation default set of delimiter
  66. characters for leading/trailing character fudging.  In other words,
  67. ' a' = '\wa'  is true,  ' a' == \wa' is false.  
  68.  
  69. To summarize:
  70.  
  71.     1 - a word delimiter is not just a blank space, it can be anything, given
  72.         the further following qualifications.
  73.     2 - each interpreter implementor may choose to select a set of default 
  74.         delimiter characters (that may be thought of as whitespace).
  75.     3 - each word oriented, builtin function will have an extra parameter that
  76.         can be used to override the implementation default.  
  77.     4 - logical comparisons will use the implementation default delimiters to
  78.         fudge the ends of strings.  Unless the strict comparator operators are 
  79.         used.  
  80.  
  81. This seems straightforward to me. The only thing missing is a way for the 
  82. programmer to completely override the implementation default delimiter set. 
  83. Perhaps something like,  Options Stream Delimiter 'abc',  for input streams, or, 
  84. Options Builtin Delimiter 'itseasyas', for builtin functions, or, 
  85. Options Default Delimiter '123', for global effect.   
  86.  
  87. ---
  88. Jerry Campbell   reply to: zjlc12@hou.amoco.com 
  89. Amoco Corp. ISD  SSS/Graphics
  90. Houston, Tx.     713/556-7036
  91.