On 3/23/21 9:58 AM, Eric Blake wrote:
On 3/23/21 8:00 AM, John Snow wrote:
On 3/23/21 5:40 AM, Markus Armbruster wrote:
+# event 'data' member with dict value is (longhand) argument
+# definition, not inline complex type

I have to be a weenie and say I don't know exactly what this comment is
telling me.

(1) What's a longhand argument?

Writing { 'type':'str', 'name':'foo' } is longhand for the corresponding
'foo':'str' shorthand.


Ah, okay. The canonical object/dict form of a member definition.

(2) What's an inline complex type?

Writing { 'command':'Foo', 'returns': { 'foo':'str' } }
or { 'union':'U', 'base': { 'foo':'Enum' } ... }

are inline complex types; they are shorthand for:

{ 'struct':'FooReturn', 'data': { 'foo':'str' } }
{ 'struct':'UBase', 'data': { 'foo':'Enum' } }
{ 'command':'Foo', 'returns':'FooReturn'  }
{ 'union':'U', 'base':'UBase' }

At one point, I had the idea that we might want to write:

{ 'union':'U', ...
   'data': { 'branch': { inline type } } }

instead of having to pre-declare the type for the branch; but that idea
is no longer feasible, since it would be awkward to distinguish from
what we DO have of:

{ 'union':'U', ...
   'data': { 'branch': { 'type':'Branch', 'if': 'COND' } } }

and where I don't really see us wanting:

{ 'union':U', ...
   'data': { 'branch': { 'type': { inline type }, 'if': 'COND' } } }

(If the situation changes and we do want anonymous inline types anywhere
a name can appear now, we'll have more work to do)


I see, ok, thanks!


Reply via email to