[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: enum instead of #define for tokens
From: |
Miles Bader |
Subject: |
Re: RFC: enum instead of #define for tokens |
Date: |
02 Apr 2002 23:45:03 +0900 |
Akim Demaille <address@hidden> writes:
> Except for extremely bizarre scenarios which I'm able to imagine, but
> fail to see the real interest, I see no difference between #define and
> enums. One such scenario would be for instance to have parts of the
> scanner compiled only when #ifdef SOME_TOKEN. Are there people using
> such idioms?
You could do both, e.g:
enum {
...
FOO,
#define FOO FOO
...
};
Then you get the advantages of a enum, but can still use #ifdef.
[I think glibc does this in some of its header files.]
-Miles
--
Come now, if we were really planning to harm you, would we be waiting here,
beside the path, in the very darkest part of the forest?
- RFC: enum instead of #define for tokens, Akim Demaille, 2002/04/02
- Re: RFC: enum instead of #define for tokens,
Miles Bader <=
- RE: enum instead of #define for tokens, Wayne Green, 2002/04/02
- Re: RFC: enum instead of #define for tokens, Paul Eggert, 2002/04/02
- Re: RFC: enum instead of #define for tokens, Akim Demaille, 2002/04/03
- Re: RFC: enum instead of #define for tokens, Paul Eggert, 2002/04/03
- Re: RFC: enum instead of #define for tokens, Akim Demaille, 2002/04/03
- Re: RFC: enum instead of #define for tokens, Hans Aberg, 2002/04/03
- Re: RFC: enum instead of #define for tokens, Akim Demaille, 2002/04/04
- Re: RFC: enum instead of #define for tokens, Hans Aberg, 2002/04/04
- Re: RFC: enum instead of #define for tokens, Akim Demaille, 2002/04/04