Sujet : Re: enum sets
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 29. Aug 2024, 20:38:07
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <adc248b239069f289ffc1b9dee4cd0fa60f2ae64@i2pn2.org>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
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