From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhXY6-0001Qm-0B for qemu-devel@nongnu.org; Thu, 01 Oct 2015 02:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhXXz-0007CM-RJ for qemu-devel@nongnu.org; Thu, 01 Oct 2015 02:41:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhXXz-0007CF-C6 for qemu-devel@nongnu.org; Thu, 01 Oct 2015 02:40:55 -0400 From: Markus Armbruster References: <1443497249-15361-1-git-send-email-eblake@redhat.com> <1443497249-15361-16-git-send-email-eblake@redhat.com> <87zj05guv8.fsf@blackfin.pond.sub.org> <560AF5A4.3000807@redhat.com> Date: Thu, 01 Oct 2015 08:40:52 +0200 In-Reply-To: <560AF5A4.3000807@redhat.com> (Eric Blake's message of "Tue, 29 Sep 2015 14:33:40 -0600") Message-ID: <87fv1vm6q3.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v6 15/16] qapi: Share gen_err_check() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Michael Roth , marcandre.lureau@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com Eric Blake writes: > On 09/29/2015 08:31 AM, Markus Armbruster wrote: >> >> To really cut the verbosity, I figure we'd have to do something more >> radical, like having cgen() recognize a (short!) pattern and replace it >> with a full-blown error check. Not sure that's actually a good idea, >> though :) > > Another radical idea would be write the python code to not care about > whitespace or indentation discrepancies, because we instead run things > through 'indent' as part of the code generation. Then we can emit ugly > code without caring about indentation or multi-line, if it makes the > python easier to write, and the output would still be nicely formatted. I believe generating perfectly neat code the way we generate code (printing text) isn't practical. Avoiding long lines in particular would take far too much effort, and make the generators much more complex and less readable. Of course, even if we piped through indent, we'd still want the generated code look neat in the generator source. But that's a different kind of neat. > I'm not sure I want to do that, though. I'm open to the idea. Right now it doesn't seem worthwhile, because we already did the work for reasonably legible generated code.