It makes sense - thanks for the explanation!

btw I would recommend that we add this info to the official protobuf
documentation (currently it is available only in the changelog)

- Srivats

On Wed, Jul 28, 2010 at 1:54 AM, Kenton Varda <[email protected]> wrote:
> Consider the case where you define a message Foo in foo.proto, and then you
> extend it in bar.proto.  When generating code for foo.proto, protoc doesn't
> necessarily know anything about bar.proto, so how could it generate anything
> based on the extensions defined there?  Instead, extensions are generated in
> the scope where they are defined.
>
> On Thu, Jul 22, 2010 at 4:41 AM, Srivats P <[email protected]> wrote:
>>
>> Hi,
>>
>> As per CHANGES.txt for "2009-05-13 version 2.1.0"
>> <snip>
>>  * For each field, the generated code contains an integer constant
>> assigned
>>    to the field number.  For example, the .proto file:
>>      message Foo { optional int bar_baz = 123; }
>>    would generate the following constants, all with the integer value 123:
>>      C++:     Foo::kBarBazFieldNumber
>>      Java:    Foo.BAR_BAZ_FIELD_NUMBER
>>      Python:  Foo.BAR_BAZ_FIELD_NUMBER
>>    Constants are also generated for extensions, with the same naming
>> scheme.
>>    These constants may be used as switch cases.
>> </snip>
>>
>> All my .proto files use a global namespace via the "package MyProto"
>> directive.
>>
>> The constants for members of message Foo are in the MyProto::Foo
>> namespace while extension members of Foo are in the MyProto::
>> namespace (not MyProto::Foo). Is this intentional? If so, the above
>> changelog snippet seems to indicate otherwise.
>>
>> Regards,
>> Srivats
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/protobuf?hl=en.
>>
>
>

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

Reply via email to