#define if!(x) if(!(x))
#define if!(x) if(!(x)) isnt allowed, I get this warning warning: "ISO C requires whitespace after the macro name"
Does anyone know why?
Does anyone know why?
Sir, e^iπ + 1 = 0, hence God exists; reply!
I'd wager a guess that the macro name can't contain !, since that a unary operator, not a character.
But why cant I use a unary operator in a define?
Sir, e^iπ + 1 = 0, hence God exists; reply!
You can, but not in the name. You're trying to define a macro named "if!".
I know, and im not allowed to
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:#define if!(x) if(!(x)) isnt allowed, I get this warning warning: "ISO C requires whitespace after the macro name"
Does anyone know why?
Why?! Because it's stupid!

Hands off operator look-alike macro definitions! You could try #define IFNOT or something similar, though i really dont see any gain. At most you save yourself from having to type a pair of parenthesis at the expensive of horribly unreadable code.
unknown Wrote:#define if!(x) if(!(x)) isnt allowed, I get this warning warning: "ISO C requires whitespace after the macro name"
Does anyone know why?
You should be a lisp user...
if!(x) if(!(x)) saves a set of brackets...
im just doing fi instead because its if written backwards, clever see!
*goes off to check out lisp
*shudders at the number of brackets he see's
im just doing fi instead because its if written backwards, clever see!
*goes off to check out lisp
*shudders at the number of brackets he see's
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:if!(x) if(!(x)) saves a set of brackets...
im just doing fi instead because its if written backwards, clever see!
*goes off to check out lisp
*shudders at the number of brackets he see's
Those are parentheses, not brackets, and they are beautiful.
-Jon
Code:
#define ifn(x) if (!(x))is just as few characters. I still think you're nuts though
I am
.
this works nicely too:
#define while_dont(x) while(!(x))
.this works nicely too:
#define while_dont(x) while(!(x))
Sir, e^iπ + 1 = 0, hence God exists; reply!
unknown Wrote:I am![]()
![]()
.
this works nicely too:
#define while_dont(x) while(!(x))
Make sure you never show that to anyone of authority, they might have you locked up and/or dumped into the gutter for that.
"while_not" is more usually called "until" in english
oh yeah!
That totally slipped my mind.
That totally slipped my mind.
Sir, e^iπ + 1 = 0, hence God exists; reply!

