On 03/09/2011 04:47 PM, Anthony Liguori wrote:
[
{ 'type': 'MyType', fields: [['a', 'str'], ['b', 'int'], ['c',
'AnotherType']] }
{ 'event': 'MY_EVENT', 'arguments': [ ... ] }
{ 'command': 'my-command', 'arguments': [ ... ], 'return': ... }
]
which leaves us room for additional metainformation.
The concern is more about non-qemu consumers of the schema.
Yeah, I dislike it too and I've been leaning towards changing it.
My preference would be:
{ 'type': 'MyType', 'fields': { 'a': 'str', 'b': 'int', 'c':
'AnotherType' } }
{ 'event': 'MY_EVENT', 'arguments': {...} }
{ 'command': 'my-command', 'arguments': {...}, 'returns': 'int' }
I do prefer the dictionary syntax for arguments over a list because a
list implies order. Plus I think the syntax is just awkward and a
whole lot easier to get wrong (too many/few elements in list).
Yeah. We can rationalize it by saying that most dynamic consumers of
the schema will not care about argument order, and that if they do, they
can implement a custom parser.
I don't think I want to make this sort of change just yet. Also note
that the schema that will be exposed over the wire is not directly
related to the schema we use for code generation.
Right, we have to nail down the format for the former, though.
--
error compiling committee.c: too many arguments to function