YAAO (yet another assignment operator)

Brandon Allbery bsa at ncoast.UUCP
Sat Dec 22 10:32:40 AEST 1984

It's been stated that allowing x->=y would produce an RHS that was not
anything usual, and comments about Pascal `with' statements were made.
On this topic... I've noticed that one of the hidden error messages in
our compiler makes it seem that under certain circumstances, you could
use exactly this form in an ordinary expression:  specifically,

	int bar;
		int i_val;
		float i_something;

	i_val = bar;

or its equivalent in the opposite direction, as long as you didn't have
more than one variable which was supposed to use that struct member (shades
of COBOL! :-).  Maybe I read it wrongly... but maybe this isn't the problem
it might be.

I've considered the usefulness of both with blocks and ->= ; I can see
uses for both, but not many.  And for ->= , the problem discussed with
&& vs. ^^ applies:  += , et al., are signals to the compiler to optimize.
I'm not sure that x=x->g (equiv. x=(*x).g, or x = (*x)+offset) can really
be optimized that much, so ->= is simply shorthand.  Maybe a preprocessor?

(As for with:  At least the syntax would be regular:  with (var) stmts .
That doesn't mean I like it.)

  Brandon Allbery @ decvax!cwruecmp!ncoast!bsa (..ncoast!tdi1!bsa business)
6504 Chestnut Road, Independence, Ohio 44131   (216) 524-1416
<<<<<< An equal opportunity employer: I both create and destroy bugs :-) >>>>>>

More information about the Comp.lang.c mailing list