Deutsch English Français Italiano |
<025bd7e883b83b4c46e49664bf7287eeaf1c10f8@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 15:37:43 +0200 Organization: i2pn2 (i2pn.org) Message-ID: <025bd7e883b83b4c46e49664bf7287eeaf1c10f8@i2pn2.org> References: <vaoclb$3lfbf$1@dont-email.me> <3be5b29ade1ce269874ab1ef8abf1bd666a7fc9c@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 29 Aug 2024 13:37:47 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="145076"; 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: <3be5b29ade1ce269874ab1ef8abf1bd666a7fc9c@i2pn2.org> X-Spam-Checker-Version: SpamAssassin 4.0.0 Bytes: 2782 Lines: 74 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. >> >> > reading yet once i dont know what you want > > i guess you maybe say what i understand as kinda "micro dictionary" > > i mean say 32 bits of enum offes space to give some section for > "keys" and some section for "values" (for example upper 8 bits > for keys 1-255 enumized or not - and 24 bits for values - also enumized > or not...such microdictionary is good idea..i guess people > sometimes use it but in fact enum statement dont support it afair > > though as i said the form of defining it > > enum > { > AJHJH > { > KJHZ, > HJKJHG, > HJHJH, > } > AJJHKJH > { > KJHZ, > HJKJHG, > HJHJH, > } > > } > > may be probably bad becouse you want to have 2 keys so > it should be more like > > enum A:shbshb > enum B:shbshbskjs > enum B:shbshbjskj > enum A:B:shbshbskjs > > wonder if such micro dictionary should hovever be called enom it is dictionary but micro dict T1 'a' = 0x8989 , 'b' = 0x2989 , 'c' = 0x8289 ,t T1 'd' = 0x8933, 'e' = 0x89d9, 'f' = 0x898d;, 'b':1 = 0xffff ads few entries to micro dictionary named T1 then T1('a') would yeild to 0x8989 then T1('b') would eventually yeild to {0x2989, 0xffff }