[comp.lang.pascal] Var parameter aliases?

markhall@pyrps5 (Mark Hall) (07/14/89)

Could someone please tell me if the Pascal language (and its
variants) has a definite policy concerning aliases between var
parameters and/or uplevel variables?

In J&W, second edition, the following appears (pg. 71):

	...if x1..xN are the actual variables that correspond
	to the formal variable parmeters v1..vN, then x1..xN 
	should be distinct variables.
        ^^^^^^

If ``should'' were ``must'', it would mean that 
parameters could not be aliases for each other (although it does
not preclude aliasing between parms and uplevel variables).

Can anyone interpret what ANSI X3J9 has to say on the subject?
I found the sections 6.6.3.3 and 6.7.3 to be rather obtuse.

I'm trying to determine whether or not
it is safe to optimize common subexpressions in contexts like:

	procedure p( var i,k:integer );
		var x,y;
		begin
		x := i+100;
		k := i-1;
		y := i+100; (* if i,k are aliases, then this is not a CSE *)
		...
		end;

I'd also like to know what the policy is for aliases between
uplevel variables and variable parameters.

Thanks.
-Mark Hall (smart mailer): markhall@pyrps5.pyramid.com
	   (uucp paths): {ames|decwrl|sun|seismo}!pyramid!markhall

P.S. sorry if I didn't notice the new-cut smell of a freshly mown topic.