Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site rochester.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rochester!ken
From: ken@rochester.UUCP (Ken Yap)
Newsgroups: net.lang
Subject: Constants in subroutine calls
Message-ID: <5143@rochester.UUCP>
Date: Sun, 6-Jan-85 09:43:44 EST
Article-I.D.: rocheste.5143
Posted: Sun Jan  6 09:43:44 1985
Date-Received: Tue, 8-Jan-85 02:40:17 EST
References: <6599@brl-tgr.ARPA> <979@opus.UUCP> <1146@ut-ngp.UUCP> <18397@lanl.ARPA> <472@intelca.UUCP>
Reply-To: ken@rochester.UUCP (Ken Yap)
Organization: U. of Rochester, CS Dept.
Lines: 17
Summary: 

The problem is not using constants in subroutine calls per se but
changing a parameter that corresponds to a constant.

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. True, you
may get an obscure error message if your run-time doesn't understand
what happened but it is better than carrying on innocently.

Can anybody tell me if there are other compilers out there that also do
this? If not, is there any reason this is not more widely practiced?
(Other than lack of memory management hardware, that is.)
-- 
	Ken Yap

UUCP: (..!{allegra, decvax, seismo}!rochester!ken) ARPA: ken@rochester.arpa
USnail:	Dept. of Comp. Sci., U. of Rochester, NY 14627. Voice: Ken!