Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!sde@Mitre-Bedford
From: sde@Mitre-Bedford
Newsgroups: net.lang.c
Subject: Re: YAAO  (yet another assignment operator)
Message-ID: <6799@brl-tgr.ARPA>
Date: Thu, 27-Dec-84 19:22:42 EST
Article-I.D.: brl-tgr.6799
Posted: Thu Dec 27 19:22:42 1984
Date-Received: Sat, 29-Dec-84 02:54:43 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 31


	>>
	>>I can see two purposes of this = operator:
	>>
	>>1.	More dense, compact or readable programs.
	>>
------>>2.Make more efficient programs when the compiler isn't smart enough
	>>	to see this himself.

	>>...
	>>In this case, I am more interested in point 2. Why not expand this
	>>to the more general case where
	>>	>>X = ... X ...;
	>>can be rewritten to an expression where the address of X only needs to
	>>be calculated once. The syntax for this could be
	>>	>>let X = expr in ... X ...;
	>>for example
	>>	>>let x = a[j*10+i] in x = func(x);
	>>This example shows a case where the compiler could not do this
	>>optimization if 'j' or 'i' was (sic) global variables(sic). Another
	>>syntactic form could be
	>>	>>X = expr @ ... X ...;
	>>This construction already exists in some languages.

I shudder to suggest this, but if you want that effect, how about:

register float *y;
...
*(y=&a[...]) = func( *y );

    David   sde@mitre-bedford