In other words, the scoping semantics are just like C++ namespaces, but we
use . rather than :: as the scope separator.

On Thu, Jul 30, 2009 at 1:50 AM, Constantinos Michael
<cmmich...@gmail.com>wrote:

> Try doing this:
> message foo {
>   message X { }
>   message bar {
>     message X { }
>     message abc {
>       *optional foo.X abc_x = 1;*
>     }
>   }
> }
>
> You can also prefix the type with a dot, e.g.
>
> optional *.**foo.X* abc_x = 1;
>
> That has the effect of fully qualifying the message, as you can enclose the
> entire message foo above in another message foo, which also provides an X,
> and have these fields in the innermost message:
>
> optional *.**foo.X* x1 = 1;   // outer foo
> optional *.**foo.foo.X* x2 = 2;  // inner foo
> optional *foo.X* x3 = 3;  // inner foo
>
> -Constantinos
>
> On Thu, Jul 30, 2009 at 5:22 AM, naderp <paul.na...@gmail.com> wrote:
>
>>
>> Hi,
>>
>> Does the protocol buffer language have a mechanism for resolving types
>> across scopes. Eg, given
>>
>> message foo {
>>    message X {}
>>
>>    message bar {
>>        message X{}
>>
>>        message abc {
>>            message foo:X    <----------- This is not legal, but how
>> do you do it?
>>
>>        }
>>    }
>> }
>>
>> Thanks.
>>
>>
>
>
> --
> - Constantinos Michael
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to