From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzB7h-0006Ws-GC for qemu-devel@nongnu.org; Wed, 18 Nov 2015 17:22:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzB7e-0002hL-89 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 17:22:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzB7e-0002hD-3f for qemu-devel@nongnu.org; Wed, 18 Nov 2015 17:22:38 -0500 References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-28-git-send-email-eblake@redhat.com> <87poz7me0g.fsf@blackfin.pond.sub.org> <564CF727.8020507@redhat.com> From: Eric Blake Message-ID: <564CFA27.5080108@redhat.com> Date: Wed, 18 Nov 2015 15:22:31 -0700 MIME-Version: 1.0 In-Reply-To: <564CF727.8020507@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lq9dv2UoTqAxCGopEo49mgV4cJWoBCnTj" Subject: Re: [Qemu-devel] [PATCH v12 27/36] qapi: Forbid case-insensitive clashes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lq9dv2UoTqAxCGopEo49mgV4cJWoBCnTj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/18/2015 03:09 PM, Eric Blake wrote: > On 11/18/2015 10:08 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> In general, designing user interfaces that rely on case >>> distinction is poor practice. Another benefit of enforcing >>> a restriction against case-insensitive clashes is that we >>> no longer have to worry about the situation of enum values >>> that could be distinguished by case if mapped by c_name(), >>> but which cannot be distinguished when mapped to C as >>> ALL_CAPS by c_enum_const() [via c_name(name, False).upper()]. >>> Thus, having the generator look for case collisions up front >>> will prevent developers from worrying whether different >>> munging rules for member names compared to enum values as a >>> discriminator will cause any problems in qapi unions. >>> >=20 >> Another possible improvement is hiding the case-folding logic in >> methods. Have a QAPISchemaEntity.c_namecase() that returns >> self.c_name().lower(). Overwrite it in QAPISchemaEvent to return >> .upper() instead. Use it to make _def_entity() less ugly. >> >> Probably not worthwhile unless more uses of .c_namecase() pop up. >=20 > I kind of like it. I think I'll propose a 26.5 that implements that, > then redo 27 on top of it (without reposting the entire series). Actually, it's not worth splitting that into a separate patch (it was just 6 lines, and I couldn't find any other uses). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lq9dv2UoTqAxCGopEo49mgV4cJWoBCnTj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWTPonAAoJEKeha0olJ0NqjY0H/R7t9/KI+ZTc0bxj7iNSJLIx c7pcJJGhiaP20LYPncsipFovDzZaVdGMmDG8+P7So9NEWj4xtZ6sSO0fPbT7k52u HDsYlh8kNpGKXNBG0EeNoXr2bJ5WWydu/LQeKw6RZzExyUmFqDprid2OoXylo9SI lDfymSBEGO5ptvQKm2C19BDTshBx8Jkg4/LCgA2IAsSHgmLpxOYGemlziqs9n8hm xA0Eq1HtdGUMN/mEanEfwMT7s2E9SHWJkginA6GQkgZqw374kISrAY4JdAXXRPLi VaXlUpz9AQKAWced9i05P9wOnzshDwMjuLBlgvCTrV5pDqKuwHi9UVu44OFchLI= =ucNi -----END PGP SIGNATURE----- --lq9dv2UoTqAxCGopEo49mgV4cJWoBCnTj--