Re: stratgies for organizing elements in a passed array
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Sun, 05 Apr 2009 14:51:34 GMT
On 2009-04-05 08:27:07 -0300, nmm1@xxxxxxxxx said:
In article <49d89fe3@xxxxxxxxxxxxxxxxx>,
Louis Krupp <lkrupp_nospam@xxxxxxxxxxxxxxxx> wrote:
In article <1ixn5bi.5crv6fwr383kN%nospam@xxxxxxxxxxxxx>,
Richard Maine <nospam@xxxxxxxxxxxxx> wrote:
Note that enumerations in f2003 are incredibly trivial. They are so
trivial that you don't need f2003 to do exactly the same thing. An f2003
enumeration is nothing except a special syntax to declare a set of named
constants. You don't need f2003 to declare a set of named constants.
Just use the normal syntax.
Despite what the syntax implies, that's also true in C (and, I think,
C++). That's why I never use them - they provide nothing useful, not
even clarification.
gdb knows about C enums and displays the name instead of the integer
value. I don't know if this is true for other debuggers or for f2003.
De minimis non curat lex.
Thanks for the correction, but that scarcely justifies their inclusion
in the language. I assume that you mean gdb on 'gcc -g' code, because
I should be surprised if it worked on anything else.
Regards,
Nick Maclaren.
I have several small keyword driven "languages" where it is natural
to have symbolic names for the various keywords. It is very convenient to
have a mechanism that assigns unique values with no intervention on my part.
I use an old preprocessor to get the equivalent of an enum. One might use
string values rather than integer values or perhaps something else but the
enum sure is handy for 100+ keywords with a few changes as I fiddle with
things. I have other situations were I find that manually assigned values
make more sense to me.
enums "provide nothing useful" is an overstatement even if good natural uses
are less common that some claim. I find unique value is the requirement with
next value a simple way to get it.
.
- Follow-Ups:
- References:
- stratgies for organizing elements in a passed array
- From: gyro
- Re: stratgies for organizing elements in a passed array
- From: Damian
- Re: stratgies for organizing elements in a passed array
- From: Richard Maine
- Re: stratgies for organizing elements in a passed array
- From: nmm1
- Re: stratgies for organizing elements in a passed array
- From: Louis Krupp
- Re: stratgies for organizing elements in a passed array
- From: nmm1
- stratgies for organizing elements in a passed array
- Prev by Date: Re: fortran 200X proposal: "use none" counterpart to "implicit none"
- Next by Date: Re: Compilation takes infinitely long
- Previous by thread: Re: stratgies for organizing elements in a passed array
- Next by thread: Re: stratgies for organizing elements in a passed array
- Index(es):
Relevant Pages
|