2 ms·
I realize it's a bit nit-picky and off-topic, but it was interesting to see C written with spaces around the "->" (access structure field through pointer) opera
by unwind 15y ago
I realize it's a bit nit-picky and off-topic, but it was interesting to see C written with spaces around the "->" (access structure field through pointer) operator.
What is almost always written as "a->b = c;" is written as "a -> b = c;" in the Tofu code.
I guess doing so makes sense if you also promote writing "a = b + c;" (which I do), but it was still novel-looking, to me. I guess you can treat -> as any other binary operator.
- al3xbio 15y agoI actually find "->" with spaces cleaner and easier to read (just like with almost all the other operators). The "->" operatore without spaces around is very popular (also in Perl code AFAICS), and I sometimes wonder why people do put spaces around e.g. "+" and "=" but not "->".
- ZitchDog 15y agoI always figured it was due to it's similarity to the . operator, which never has spaces around it.