Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site dartvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!dartvax!davidg From: davidg@dartvax.UUCP (David Gelhar) Newsgroups: net.lang Subject: Re: Constants in subroutine calls Message-ID: <2684@dartvax.UUCP> Date: Tue, 8-Jan-85 11:57:22 EST Article-I.D.: dartvax.2684 Posted: Tue Jan 8 11:57:22 1985 Date-Received: Thu, 10-Jan-85 07:05:58 EST References: <6599@brl-tgr.ARPA> <979@opus.UUCP> <1146@ut-ngp.UUCP> <18397@lanl.ARPA> <472@intelca.UUCP> <5143@rochester.UUCP> Organization: Dartmouth College, Hanover, NH Lines: 13 > BTW I saw a neat way of trapping this sort of error without any > run-time overhead in the VMS Fortran compiler. Constants are placed in > a read-only segment and the VM system traps any violation. The DTSS PL/1 compiler also knows how to keep constants in a read-only segment to allow them to be passed by reference. At the moment though, this is done only in a special compiler mode used for compiling the operating system; it is stylistically unpleasant to assign to a parameter that was passed a constant, but the language semantics allow it. For the operating system, the efficiency gained by passing write-protected constants by reference instead of making a copy was judged to be worth the price of altering normal PL/1 semantics a bit, but this is not done by default, lest novice users be baffled.