Received: from eggs.gnu.org ([2001:4830:134:3::10]:42606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWoVe-0002cB-W9 for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:29:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWoVY-0007DD-GK for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:29:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWoVY-0007Bv-8z for qemu-devel@nongnu.org; Wed, 24 Sep 2014 11:29:32 -0400 From: Markus Armbruster References: <1411165504-18198-1-git-send-email-eblake@redhat.com> <1411165504-18198-11-git-send-email-eblake@redhat.com> <87a95pz0us.fsf@blackfin.pond.sub.org> <5422D0D7.2060405@redhat.com> Date: Wed, 24 Sep 2014 17:29:22 +0200 In-Reply-To: <5422D0D7.2060405@redhat.com> (Eric Blake's message of "Wed, 24 Sep 2014 08:10:31 -0600") Message-ID: <87lhp9m3zh.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 10/19] qapi: Better error messages for duplicated expressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Luiz Capitulino , Fam Zheng , qemu-devel@nongnu.org, wenchaoqemu@gmail.com Eric Blake writes: > On 09/24/2014 05:58 AM, Markus Armbruster wrote: > >> >> We have separate name spaces for events, commands and types. Works for >> me. A single name space would work for me, too. > > I thought about that too. Our conventions are that commands are > all-lower-case, events are ALL_UPPER, and user-defined types are > CamelCase - so a single namespace would not have any collisions, except > for one case: built-in types like 'int' are also all lower, which > collides with commands. But I see no technical reason why we wouldn't > be able to generate C code for a command named 'int'. I can go either > way, but should probably add a test for a .json file that does > {'command':'int'} to test which way we go. Preferences on whether that > should be allowed or forbidden? With a single name space, 'command': 'int' should collide with the built-in type. With separate name spaces, it should in theory just work. No big deal if it doesn't due to generator sloppiness or something. As I said, I'm fine both with keeping the current separate name space, and with switching to a single name space. Either way, documentation would be nice.