From owner-freebsd-arch@FreeBSD.ORG Thu Jul 25 20:27:49 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 11A1D5E5 for ; Thu, 25 Jul 2013 20:27:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id CA5A92E2B for ; Thu, 25 Jul 2013 20:27:48 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id AD7D11FE; Thu, 25 Jul 2013 22:22:50 +0200 (CEST) Date: Thu, 25 Jul 2013 22:28:32 +0200 From: Pawel Jakub Dawidek To: "Jordan K. Hubbard" Subject: Re: General purpose library for name/value pairs. Message-ID: <20130725202832.GD1400@garage.freebsd.pl> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kvUQC+jR9YzypDnK" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 20:27:49 -0000 --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 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 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--