home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!wupost!ukma!rutgers!concert!borg!news_server!martinc
- From: martinc@grover.cs.unc.edu (Charles R. Martin)
- Newsgroups: comp.lang.rexx
- Subject: Re: NOVALUE (was: Blanks, REXX, and portability...)
- Message-ID: <MARTINC.92Sep10225633@grover.cs.unc.edu>
- Date: 11 Sep 92 02:56:33 GMT
- References: <19920910194427SEB1525@MVS.draper.com> <5456@unixhub.SLAC.Stanford.EDU>
- Sender: news@cs.unc.edu
- Organization: UNC Department of Computer Science
- Lines: 56
- In-reply-to: bobcook@unixhub.SLAC.Stanford.EDU's message of 11 Sep 92 01:17:32 GMT
-
- In article <5456@unixhub.SLAC.Stanford.EDU> bobcook@unixhub.SLAC.Stanford.EDU (Bob Cook) writes:
-
- (Somewhat) unfortunately, SIGNAL ON NOVALUE doesn't catch all of the
- uses of an undefined variable. At least, it doesn't on VM/CMS. In
- the following piece of code, the "say" statement produces "Hi" on the
- console, even though it uses the variable named X, which has never
- been initialized.
-
- signal on novalue
- dummy = 'X'
- a.dummy = 'Hi'
- say a.x
- exit
- Novalue: Say 'Oops'
-
- I'm pretty new at this, but I *think* that's the defined behavior, not a
- bug. Notice that
-
- say x
- exit
-
- prints
-
- X
-
- to the output stream. Further notice that
-
- /* signal on novalue */
- dummy = 'B'
- a.dummy = 'Hi'
- say a.x
- say a.b
- exit
- Novalue: Say 'Oops'
-
- prints
-
- A.X
- Hi
-
- (the signal is commented out because the brain-damaged excuse for a rexx
- I've currently got on this system doesn't speak "signal on novalue".
- No, Anders, it wasn't regina.)
-
- Anyway, I think it's clear that what is happening is that the stem
- reference is "dereferenced" if the RHS of the stem is a variable, but
- used directly as a string if not, at least in a "say" clause.
- --
- Charles R. Martin/(Charlie)/martinc@cs.unc.edu/(ne crm@cs.duke.edu)
- O/Dept. of Computer Science/CB #3175 UNC-CH/Chapel Hill, NC 27599-3175
- H/3611 University Dr #13M/Durham, NC 27707/(919) 419 1754
- ----------------------------------------------------------------------
- "I am he who walks the States with a barb'd tongue, questioning every
- one I meet,/Who are you that wanted only to be told what you knew
- before?/ Who are you that wanted only a book to join you in your
- nonsense?" _Leaves of Grass_ xxiii.4.
-