Re: stratgies for organizing elements in a passed array



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.



.



Relevant Pages

  • Re: Enumerated types
    ... Enum ACGroup ... I cannot then access the members of the group. ... One alternative I could try, in the mean time, is to declare a string array ...
    (microsoft.public.access.formscoding)
  • Re: non-static method gotcha
    ... the declared enum, 'SubmissionSite' in your example. ... Its effect is to declare that C is not an inner class. ... extends the immediately enclosing enum type. ... decompiled anonymous class. ...
    (comp.lang.java.help)
  • Re: Newbie Question
    ... It may be a problem but the compiler error clearly stated that he tried to ... declare a method where only a class, delegate, enum, interface, or struct is ... >> public static extern int SendCharFmtMsg(IntPtr hWnd, int Msg, int ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: enum safety
    ... 'Although variables of enum types may be declared, ... you declare declare a valid ... A C enumerated type doesn't act like an enumerated type in, say, ...
    (comp.lang.c)