Re: So what Standard are we working off?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 30 Jun 2006 18:30:04 GMT
Richard Heathfield <invalid@xxxxxxxxxxxxxxx> writes:
Keith Thompson said:
<snip>
I wouldn't avoid "new" and "class" in C code; C++ is a different
language. But C99 is a new version of the same language, and it just
might catch on.
Yes, it might, and so of course I /do/ avoid clashes in C90 code. I might
/think/ about using restrict as an identifier, but I don't actually do it.
(In fact, a few years ago I discovered that I had done precisely that, in a
program written before I'd ever heard of C99. Although that program has
never encountered a C99 compiler, I changed the code anyway. ISTR that I
used "constrain" instead.
But C0X people should bear in mind that our namespace is already crowded
enough, and should invade it no more.
On the other hand, there's something to be said for a clean language
design. Assuming that the functionality of "restrict" is something
worth having in the language, I can't think of a cleaner way to
specify it than with a new keyword. (It could have been "_Restrict",
I suppose.)
Or they could have invented yet another meaning for "static". 8-)}
There's always a conflict between (a) preserving existing code, and
(b) adding new features using the clean syntax they would have had if
they'd been in the language in the first place. I'm certainly
sympathetic to both needs. In the case of "restrict", I tend to think
that breaking the small amount of code that used it as an identifier
wasn't too high a price to pay.
In the case of "bool", the committee chose to add "_Bool" as a
keyword, and put the "bool", "true", and "false" identifiers in a new
predefined header. Since the new identifiers are already in common
use, I think that was a good choice -- though of course it wouldn't
have been done that way in the first place.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- So what Standard are we working off?
- From: Frederick Gotham
- Re: So what Standard are we working off?
- From: Keith Thompson
- Re: So what Standard are we working off?
- From: Frederick Gotham
- Re: So what Standard are we working off?
- From: Richard Heathfield
- Re: So what Standard are we working off?
- From: Mark F. Haigh
- Re: So what Standard are we working off?
- From: Richard Heathfield
- Re: So what Standard are we working off?
- From: Harald van Dijk
- Re: So what Standard are we working off?
- From: Richard Heathfield
- Re: So what Standard are we working off?
- From: Keith Thompson
- Re: So what Standard are we working off?
- From: Richard Heathfield
- So what Standard are we working off?
- Prev by Date: Choosing function parameter types - pointers or objects?
- Next by Date: Re: Scope of specifier extern
- Previous by thread: Re: So what Standard are we working off?
- Next by thread: Re: So what Standard are we working off?
- Index(es):
Relevant Pages
|