Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Oscar Morales Vivó <email@hidden>
- Date: Thu, 12 Jun 2003 12:06:53 +0200
The fact of the matter is that I always use those keywords, as they
make my code far more readable. I never had trouble with '=' vs '==',
but I was bitten once too many by the '&' vs '&&' bug. Nowadays I just
keep '&' with a single meaning (address of) which is better for
everyone. There's already too many overloaded symbols in C as it is
(obviously C++ can make the problem far worse).
You might not think it does make it more readable (graphics vs. text,
the same reason braces are more readable than begin-end pairs), but
syntax coloring makes the opposite point true. I find it far easier to
follow a conditional expression when the logical operators are all
marked blue.
Consequently I really miss an 'equals'/'eq' whatever keyword.
But I guess all this thread boils down to the fact that Kernighan &
Ritchie were too cheap to use ':=' as the assignment operator...
BTW, hasn't C99 made all those (and/or/bitand/not_eq...) into keywords?
On Thursday, Jun 12, 2003, at 05:18 Europe/Madrid, Andrew Pinski wrote:
On Wednesday, Jun 11, 2003, at 20:32 US/Eastern, Matthew Toia wrote:
#define and &&
#define or ||
#define not !
are actually C++ standard keywords now. (i.e. can be used without any
macros)
g++ doesn't seem to agree with you, though it makes _some_ sense.
Which version, 3.0 included them as keywords.
In fact it was added by this patch:
Thu Nov 17 15:30:50 1994 Mike Stump <email@hidden>
* gxx.gperf, hash.h, lex.c (init_lex, real_yylex), parse.y:
Add new
ANSI keywords and, and_eq, bitand, bitor, explicit, namespace,
not,
not_eq, or, or_eq, typename, using, xor, xor_eq to g++. Still
need
to add support for explicit, namespace, typename, and using,
support
for the rest is already in.
Thanks,
Andrew Pinski
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
/*
Oscar Morales Vivs
Eternal Computer Science Student. Master of C++ Templates. Cocoa Nut.
Computer Graphics Illuminati. UI Guru in Training. Dabbler in all
things CS and most which are not.
Web stuff:
http://homepage.mac.com/oscarmv/index.html
*/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.