New assignment operator ->= ?

amos shapira amoss at batata.huji.ac.il
Sat Feb 17 11:29:48 AEST 1990


mayoff at walt.cc.utexas.edu (Rob "The" Mayoff) writes:

>Well, what about ->?  In tracing linked lists, I often do something like:
> p = head;
> while (*p->next)
>   p = p->next;
>to get to the end, or something similar.  So why not
> p = head;
> while (*p->next)
>   p ->= next;

Well, I though just about such an operator and from the same reasons. But, as
far as I understand compilers, using such an operator will not gain much code
savings, if at all.

On the other hand it MIGHT be more readable in several places (especially
when updating a pointer who's address is given inside another structure
(like a->b->c ->= next;) but then, how meny times do you write such a code?

>Anyone else agree?

I think I will use this operator here and there if it will become a standard.

> __
>/\_\ Rob Mayoff
>\/_/ mayoff at ccwf.cc.utexas.edu

- Amos Shapira

amoss at batata.bitnet
amoss at batata.huji.ac.il



More information about the Comp.lang.c mailing list