From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
akong@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qapi: Allow setting default values for optional parameters
Date: Tue, 06 May 2014 06:35:49 -0600 [thread overview]
Message-ID: <5368D725.3080109@redhat.com> (raw)
In-Reply-To: <874n131ba8.fsf@blackfin.pond.sub.org>
[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]
On 05/06/2014 03:55 AM, Markus Armbruster wrote:
>> Keeping the input file easy to write, and more compact than what
>> introspection will output, is a fine tradeoff in my book (easier to
>> maintain if there is less to type; while still having a well-defined
>> conversion to the formal output form).
>
> Unlike the other sugared form, this one adds syntax beyond JSON, namely
> in some (but not all) member names, and that makes it a bit harder to
> stomach for me.
JSON has no requirement that a 'name':'value' object limit the 'name'
portion to just valid identifier characters. But I do see your point
about the fact that we are parsing a sigil of '*' as the first character
of 'name' as sugar.
>
> Whether it's worthwhile depends on how common the case "optional, no
> default" turns out to be. Wait and see.
It's already VERY common - every optional variable already uses the
syntax. The question is rather: how many optional variables will be
rewritten to express a default value, vs. those that can be left alone
because the default value is good enough. A global search-and-replace
could rewrite the entire file to the new syntax for optional variables,
and we could enforce the new more verbose style going forward, but is
the churn worth it?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-05-06 12:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1398764656-27534-1-git-send-email-famz@redhat.com>
[not found] ` <1398764656-27534-2-git-send-email-famz@redhat.com>
[not found] ` <535F9E40.8010407@redhat.com>
2014-05-05 8:33 ` [Qemu-devel] [PATCH v2 1/2] qapi: Allow decimal values Markus Armbruster
[not found] ` <1398764656-27534-3-git-send-email-famz@redhat.com>
[not found] ` <20140429112436.GE4835@noname.str.redhat.com>
[not found] ` <535FA06F.2060603@redhat.com>
2014-05-04 3:14 ` [Qemu-devel] [PATCH v2 2/2] qapi: Allow setting default values for optional parameters Fam Zheng
2014-05-05 9:51 ` Markus Armbruster
2014-05-05 15:13 ` Eric Blake
2014-05-05 11:06 ` Markus Armbruster
2014-05-05 15:18 ` Eric Blake
2014-05-05 17:34 ` Markus Armbruster
2014-05-05 23:03 ` Eric Blake
2014-05-06 9:55 ` Markus Armbruster
2014-05-06 12:35 ` Eric Blake [this message]
2014-05-06 15:09 ` Markus Armbruster
2014-05-06 1:30 ` Fam Zheng
2014-05-06 3:09 ` Eric Blake
2014-05-06 5:11 ` Fam Zheng
2014-05-06 11:57 ` Markus Armbruster
2014-05-06 11:53 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5368D725.3080109@redhat.com \
--to=eblake@redhat.com \
--cc=akong@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).