[Library Release] dproto
Jesse Phillips
Jesse.K.Phillips+D at gmail.com
Tue Oct 8 22:55:31 PDT 2013
On Tuesday, 8 October 2013 at 08:11:34 UTC, Kagamin wrote:
> On Saturday, 5 October 2013 at 20:56:21 UTC, Matt Soucy wrote:
>> message Point {
>> optional int32 x = 1 [default=166];
>> required int32 y = 2;
>> optional string label = 3;
>> message Coord {
>> required int32 a = 1;
>> required int32 b = 2;
>> }
>> }
>>
>> You can get a structure that behaves as:
>>
>> struct Point {
>> int x=166;
>> int y;
>> string label;
>> struct Coord {
>> int a,b;
>> }
>> }
>
> Should it be really like that? If you just declare Coord
> struct, it doesn't place a Coord instance in Point.
It is correct. A message defined in another is just namespacing
as it is in D. If you want to include the type then the message
needs a field of that type. Groups are a way to combine this, but
they are deprecated so who'd want to support that.
More information about the Digitalmars-d-announce
mailing list