Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: fir Newsgroups: comp.lang.c Subject: Re: enum sets Date: Thu, 29 Aug 2024 20:38:07 +0200 Organization: i2pn2 (i2pn.org) Message-ID: References: <3be5b29ade1ce269874ab1ef8abf1bd666a7fc9c@i2pn2.org> <0ce67f893035672e67fa53b167e543535077df04@i2pn2.org> <65c6c0f42bad7039d830f931c518057b24feda16@i2pn2.org> <68f811a783d637cd497edb406367fcbbdb5e7288@i2pn2.org> <7ae343b8c106c86c42e19b597c8b072aa88a30e8@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 29 Aug 2024 18:38:11 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="172030"; 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: <7ae343b8c106c86c42e19b597c8b072aa88a30e8@i2pn2.org> X-Spam-Checker-Version: SpamAssassin 4.0.0 Bytes: 2694 Lines: 74 fir wrote: > how to define such microdictionary i dont know > > it could be (speaking on old c style) something like > > dictionary int some[int]; > > some[110]=10; > some['kot']='dog'; > > some[enum lalla]=enum bababa; > > such int-int implementation would need 64 bit value > those entries abowe would be 3 64 bit numbers > > > more entries for one key, no problem > > some['kot']='mors'; > > just another number added > > (so possibly two types of dictionaries can be defined if not more > > > also i gues bitfields can be used > > > dictionary signed:10 some[signed:22]; > > also such syntax probably is acceptable > > dictionary void some[signed:22][signed:10]; > > > some[29][233]; > > now this is container that stores void > > > > > > > > some curiosity is that it seems that normal array can be 'directoried' - turn in directory say you got array int tab[200]; array is a directory that kas one key form 0=199 and one int value per key )jas its start adress and ocupies 200 ints of ram) say you add a method to not revrite value under key but add one tab[22]:= 100 tab[22]:= 120 tab[22]:= 100 this can be done by just adding 3 64 bit values on a side and this construct would be a mix of array and dict made by list of key-values the underlying implementation may also be different liek array of seeds to heap based arrays too) overally c needs such builtin dictionary a lot