Date: Thu, 25 Jul 2013 22:28:32 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: "Jordan K. Hubbard" <jordan.hubbard@gmail.com> Cc: arch@FreeBSD.org Subject: Re: General purpose library for name/value pairs. Message-ID: <20130725202832.GD1400@garage.freebsd.pl> In-Reply-To: <D2E98A8F-F765-4A56-96CD-4410944A2910@turbofuzz.com> References: <20130704215329.GG1402@garage.freebsd.pl> <4818.1373008073@critter.freebsd.dk> <20130705195255.GB25842@garage.freebsd.pl> <60317.1373055040@critter.freebsd.dk> <20130708150308.GE1383@garage.freebsd.pl> <717D098F-D07E-45B0-B9F0-8D8BCEF06923@mail.turbofuzz.com> <20130708213351.GB1405@garage.freebsd.pl> <D2E98A8F-F765-4A56-96CD-4410944A2910@turbofuzz.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--kvUQC+jR9YzypDnK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Returning to this thread after a short break. I removed all {,u}int{8,16.32.64} types and implemented only 'number' type which is uint64_t. Looks much nicer now. On Mon, Jul 08, 2013 at 03:09:40PM -0700, Jordan K. Hubbard wrote: > On Jul 8, 2013, at 2:33 PM, Pawel Jakub Dawidek <pjd@FreeBSD.org> wrote: > >> String, Number, Boolean, Data, Date, Array and Dictionary are all plis= ts support, and Apple developers have gotten along pretty well for many yea= rs with that set (not supporting Dictionaries, btw, is a pretty fundamental= loss IMHO - it means you have to always iterate through lists to find your= stuff, which is meh!). > >=20 > > I do support nested nvlists. Doesn't that fill the gap? >=20 > Not really, no. In fact, once you support dictionaries, you'll find that= most people prefer them to lists since data can now be passed in order-ind= ependent fashion and evolved over time without breaking older code. Arrays= /lists are far less general purpose and used much less often (when I checke= d through a bunch of preference plists on one of my OS X boxes, I found arr= ays of <data> types to be the most common). Nested dictionaries are even f= ar more common in general practice. Not sure if you looked at the API, but with nvlist you can lookup element by name: const char *nvlist_get_string(const nvlist_t *nvl, const char *name); Or do you mean that internally it is slow as it iterates the list when looking up an element? This can be easly changed to speed up the lookups, but I don't consider it a pressing problem. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --kvUQC+jR9YzypDnK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHxinAACgkQForvXbEpPzSiygCgien2+QdxSyOJI6Ynnr2Eh4dQ DC8An0P1/5TI2ljExCjk1hdVijWGOUWb =7Fkn -----END PGP SIGNATURE----- --kvUQC+jR9YzypDnK--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130725202832.GD1400>