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

  1. Path: sparky!uunet!spool.mu.edu!wupost!ukma!rutgers!concert!borg!news_server!martinc
  2. From: martinc@grover.cs.unc.edu (Charles R. Martin)
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re: NOVALUE (was: Blanks, REXX, and portability...)
  5. Message-ID: <MARTINC.92Sep10225633@grover.cs.unc.edu>
  6. Date: 11 Sep 92 02:56:33 GMT
  7. References: <19920910194427SEB1525@MVS.draper.com> <5456@unixhub.SLAC.Stanford.EDU>
  8. Sender: news@cs.unc.edu
  9. Organization: UNC Department of Computer Science
  10. Lines: 56
  11. In-reply-to: bobcook@unixhub.SLAC.Stanford.EDU's message of 11 Sep 92 01:17:32 GMT
  12.  
  13. In article <5456@unixhub.SLAC.Stanford.EDU> bobcook@unixhub.SLAC.Stanford.EDU (Bob Cook) writes:
  14.  
  15.    (Somewhat) unfortunately, SIGNAL ON NOVALUE doesn't catch all of the
  16.    uses of an undefined variable.  At least, it doesn't on VM/CMS.  In
  17.    the following piece of code, the "say" statement produces "Hi" on the
  18.    console, even though it uses the variable named X, which has never
  19.    been initialized.
  20.  
  21.      signal on novalue
  22.      dummy = 'X' 
  23.      a.dummy = 'Hi'
  24.      say a.x
  25.      exit
  26.    Novalue: Say 'Oops'
  27.  
  28. I'm pretty new at this, but I *think* that's the defined behavior, not a
  29. bug.  Notice that 
  30.  
  31.     say x
  32.     exit
  33.  
  34. prints 
  35.  
  36.     X
  37.  
  38. to the output stream.  Further notice that
  39.  
  40. /*     signal on novalue  */
  41.      dummy = 'B' 
  42.      a.dummy = 'Hi'
  43.      say a.x
  44.      say a.b
  45.      exit
  46.    Novalue: Say 'Oops'
  47.  
  48. prints
  49.  
  50.     A.X
  51.     Hi
  52.  
  53. (the signal is commented out because the brain-damaged excuse for a rexx
  54. I've currently got on this system doesn't speak "signal on novalue".
  55. No, Anders, it wasn't regina.)
  56.  
  57. Anyway, I think it's clear that what is happening is that the stem
  58. reference is "dereferenced" if the RHS of the stem is a variable, but
  59. used directly as a string if not, at least in a "say" clause.
  60. --
  61. Charles R. Martin/(Charlie)/martinc@cs.unc.edu/(ne crm@cs.duke.edu) 
  62. O/Dept. of Computer Science/CB #3175 UNC-CH/Chapel Hill, NC 27599-3175
  63. H/3611 University Dr #13M/Durham, NC 27707/(919) 419 1754
  64. ----------------------------------------------------------------------
  65. "I am he who walks the States with a barb'd tongue, questioning every
  66. one I meet,/Who are you that wanted only to be told what you knew
  67. before?/ Who are you that wanted only a book to join you in your
  68. nonsense?"  _Leaves of Grass_ xxiii.4.
  69.