iDevGames Forums
#define if!(x) if(!(x)) - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: #define if!(x) if(!(x)) (/thread-4935.html)

Pages: 1 2


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 05:34 AM

#define if!(x) if(!(x)) isnt allowed, I get this warning warning: "ISO C requires whitespace after the macro name"
Does anyone know why?


#define if!(x) if(!(x)) - Fenris - Oct 8, 2005 06:13 AM

I'd wager a guess that the macro name can't contain !, since that a unary operator, not a character.


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 06:16 AM

But why cant I use a unary operator in a define?


#define if!(x) if(!(x)) - Fenris - Oct 8, 2005 06:36 AM

You can, but not in the name. You're trying to define a macro named "if!". Smile


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 06:39 AM

I know, and im not allowed to Cry


#define if!(x) if(!(x)) - DoG - Oct 8, 2005 09:12 AM

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! Rasp

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.


#define if!(x) if(!(x)) - aarku - Oct 8, 2005 10:42 AM

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...


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 11:06 AM

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


#define if!(x) if(!(x)) - aarku - Oct 8, 2005 01:14 PM

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


#define if!(x) if(!(x)) - OneSadCookie - Oct 8, 2005 03:05 PM

Code:
#define ifn(x) if (!(x))

is just as few characters. I still think you're nuts though Smile


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 04:23 PM

I am Wow Wacko Mad .
this works nicely too:
#define while_dont(x) while(!(x))


#define if!(x) if(!(x)) - DoG - Oct 8, 2005 04:36 PM

unknown Wrote:I am Wow Wacko Mad .
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.


#define if!(x) if(!(x)) - OneSadCookie - Oct 8, 2005 04:46 PM

"while_not" is more usually called "until" in english Rasp


#define if!(x) if(!(x)) - unknown - Oct 8, 2005 04:54 PM

oh yeah!
That totally slipped my mind.


#define if!(x) if(!(x)) - PowerMacX - Oct 8, 2005 09:15 PM

unknown Wrote:if!(x) if(!(x)) saves a set of brackets...
im just doing fi instead because its if written backwards, clever see!

Remember that thread about comments? Add one after every "fi (...)" Wink