[comp.lang.c++] Lack of distinction between input & output fn parameters

daniel@terra.ucsc.edu (Daniel Edelson) (09/02/90)

In article <1990Aug31.234732.29861@athena.mit.edu> ahodgson@hstbme.mit.edu.UUCP (Antony Hodgson) writes:
>
>	( EVals, EVectors ) = EigenStuff( A )
>and	if ( (X) = SomeFunction(i) == BAD_NEWS ) ...

These fragments already have definite meanings in the language.

>	( EVals, EVectors ) = EigenStuff( A )

Means:
		o Evaluate EVals.
		o Evaluate Evectors, the result must be an l-value.
		  The parentheses do not affect whether 
		  or not the result is an l-value.
		o Evaluate EigenStuff(A).
		o Perform the assignment.

>and	if ( (X) = SomeFunction(i) == BAD_NEWS ) ...

Means:
		o Evaluate SomeFunction(i) and BAD_NEWS.
		o Compare them.
		o Assign the resulting truth-value to (X),
		  which must of cource be an l-value.
		o If that ....



It is unlikely that the C++ community would accept new meanings
for parentheses. 

It is unlikely that a change such as this could be made without
the addition of at least one keyword.

The main thing on the positive side is that a program that
used this could not also be a legal ANSI C program. 
The new function declaration syntax is illegal in C or current C++.
There could not be a program: legal in both languages but 
with different meanings.

Daniel Edelson                       |  If you disagree with these 
daniel@cis.ucsc.edu, or              |  views you'll need to speak with
...!sun!practic!peren!daniel         |  my cat.