Deutsch   English   Français   Italiano  
<d25a5d97d8e6a28e97f4eebbb57bc5f249323a30@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: fir <fir@grunge.pl>
Newsgroups: comp.lang.c
Subject: Re: enum sets
Date: Thu, 29 Aug 2024 14:02:12 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <d25a5d97d8e6a28e97f4eebbb57bc5f249323a30@i2pn2.org>
References: <vaoclb$3lfbf$1@dont-email.me> <21d096d342279f8bcbb47f264401d3848c4e00aa@i2pn2.org> <vapmhq$3ullf$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 12:02:15 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="136734"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
In-Reply-To: <vapmhq$3ullf$3@dont-email.me>
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 2899
Lines: 66

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