Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Useful feature for next version of C

Name: Anonymous 2009-07-26 20:31

A ->= operator, and possibly .=, which would make it easier to go through linked lists and other such structures with lots of pointers. Instead of writing

p = p -> next;

it can now be

p ->= next;

or, if you're working with binary trees, instead of


while(t && t->v != i)
 if(t->v < i)
  t = t -> l;
 else
  t = t -> r;


it becomes


while(t && t->v != i)
 t ->= (t->v < i) ? l : r;


I'm working on a C-like compiler and I thought this would be a good idea.

Name: Anonymous 2009-07-28 17:42

>>33
you don't put macros in macros, too.
This is what Ctards actually think.
In languages supporting real macros, you can have macros which write macros for you.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List