c - Redefinition of Assignment Operator -
it in understanding several languages use := assignment operator. implemented possibly avoid confusion == operator. seemed valid point me, thinking of how implement in language c. here thinking.
#define := = // ... later on int x := 4; although work (if preprocessor supported syntax), still allow me away using = operator. question is, is there way "flag" symbol or operator / there way prevent use of defined operator or symbol? again, here thinking, don't know syntactical / semantical legality of this.
#undef =
#define := = a macro name can identifier. i'd quite surprised if c compiler accepted definition. in principle, compiler accept language extension, gcc, example, not. conforming c compiler must @ least issue diagnostic.
you works; i'm frankly skeptical. compiler using?
#undef = same problem.
i can see (and agree with) point using := rather = assignment operator have been better idea. using preprocessor alter language this, in cases works, idea.
c programmers know = means assignment. reading code can guess := meant assignment, make code harder read.
Comments
Post a Comment