Re: enum sets

Liste des GroupesRevenir à cl c  
Sujet : Re: enum sets
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.c
Date : 29. Aug 2024, 14:02:12
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <d25a5d97d8e6a28e97f4eebbb57bc5f249323a30@i2pn2.org>
References : 1 2 3
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Thiago Adams wrote:
On 29/08/2024 05:18, fir wrote:
Thiago Adams wrote:
I am wondering how useful would be to have enum sets.
>
Let´s say you have a function that accepts only monospaced fonts.Then
you can use enum monospaced_font_type. Or a switch case where you need
to check all and only monospaced_font_type.
>
But at same type you can store at same object monospaced_font_type or
font_type.
>
enum font_type
{
     enum monospaced_font_type
     {
         CASCADIA_FONT,
     },
     ARIAL_FONT
};
>
This could be arranged in any way.
>
>
>
this is about general problem of what i name polymorphism
>
>
I was considering the name polymorphic enum. But polymorphism is more
about hierarchies.
>
For this feature it can be any set you want. We can have duplicates.
>
enum  E
{
    enum set1 {
       A
    },
    enum set2 {
       A,
       B
    }
}
>
>
if yu want tag enums a(And then use this tag) then this way
wouldnt work in generally as you will drown in combinatorical swamp
(and also on this i was writing before writing subtypes should
be defined on rightside
say you have real byg set of enums and you got 10 suptypes (tags) (A B C D E F G H I J) of
enyms each one have about 100 enums of that tag you then need
to define also types that have combination of tags AB AJ AD F G FGJ BD BG ....
and youre drowned
i dont know hovewer what you need to do as you write this way one could
sit and think what youre talking about - and i got no time
(typical for programming groups though and what i write is also
probably of this kind - describing some things in programming may be quite hermetic to read)
as to enums i dislike them a lot.. realy sometimes is better tu use 'asd' and sometimes even strings and comepare by strcomp

Date Sujet#  Auteur
29 Aug 24 * enum sets29Thiago Adams
29 Aug 24 +* Re: enum sets4Keith Thompson
29 Aug 24 i+- Re: enum sets1Keith Thompson
29 Aug 24 i+- Re: enum sets1Kaz Kylheku
29 Aug 24 i`- Re: enum sets1Thiago Adams
29 Aug 24 +* Re: enum sets5David Brown
29 Aug 24 i+* Re: enum sets2Thiago Adams
29 Aug 24 ii`- Re: enum sets1Thiago Adams
29 Aug 24 i`* Re: enum sets2Blue-Maned_Hawk
29 Aug 24 i `- Re: enum sets1David Brown
29 Aug 24 +* Re: enum sets8fir
29 Aug 24 i+- Re: enum sets1fir
29 Aug 24 i+- Re: enum sets1fir
29 Aug 24 i+* Re: enum sets2fir
29 Aug 24 ii`- Re: enum sets1fir
29 Aug 24 i`* Re: enum sets3Thiago Adams
29 Aug 24 i `* Re: enum sets2fir
29 Aug 24 i  `- Re: enum sets1fir
29 Aug 24 +* Re: enum sets2Bonita Montero
29 Aug 24 i`- Re: enum sets1Thiago Adams
29 Aug 24 `* Re: enum sets9fir
29 Aug 24  +- Re: enum sets1fir
29 Aug 24  +* Re: enum sets6Thiago Adams
29 Aug 24  i`* Re: enum sets5fir
29 Aug 24  i `* Re: enum sets4fir
29 Aug 24  i  `* Re: enum sets3fir
29 Aug 24  i   `* Re: enum sets2fir
29 Aug 24  i    `- Re: enum sets1fir
29 Aug 24  `- Re: enum sets1fir

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal