home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!yuma!csn!stortek!LSTC2VM.stortek.com!GILMART
- From: GILMART@LSTC2VM.stortek.com (Paul Gilmartin)
- Newsgroups: comp.lang.rexx
- Subject: Re: NOVALUE (was: Blanks, REXX, and portability...)
- Message-ID: <1686052F.GILMART@LSTC2VM.stortek.com>
- Date: 12 Sep 92 06:22:02 GMT
- References: <19920910194427SEB1525@MVS.draper.com> <5456@unixhub.SLAC.Stanford.EDU>
- Sender: usenet@stortek.com
- Organization: StorageTek SW Engineering
- Lines: 25
-
- 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
- ^^^^^^^^ (I'd say "very" -- gil)
- >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
-
- But it would be a real pain if this were reported as an error unless there
- were some way to use explicit constants -- better by far, general expressions
- -- as compound variable indices. Namely:
-
- say a.'X' /* so I don't have to assign 'X' to dummy */
- /* and even: */
- say a.(substr('UVWXYZ',4,1)) /* Why not, haven't you wanted it? */
-
- Is anyone proposing this extremely desirable extension?
-
- gil
-