[ 
https://issues.apache.org/jira/browse/THRIFT-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13803549#comment-13803549
 ] 

Ben Sigelman commented on THRIFT-2232:
--------------------------------------

Hi Jens,
Thanks for getting back to me.

I don't use Jira often and I thus don't know how to do nice inline replies like 
you have – apologies in advance!

How to handle empty lists<>: in protobufs, declaring something as a list 
("repeated" in their parlance) is exclusive with declaring it as optional. This 
is because an empty list serializes as "" and is thus indistinguishable on the 
wire from an absent list.

In thrift, of course, lists can be declared as optional, so I can see why you'd 
want to be able to represent them as such. How does the thrift wire format 
distinguish between a present list that has no elements and an absent list, 
though?

Back to the matter at hand: either the interface approach or the 
pointer-to-field approach will break backwards compatibility. I think the 
latter would be closer to the existing impl and also closer to the spirit of Go 
programming in general, so I favor it. What do you think/prefer? I really do 
feel strongly that the current impl is unacceptable, though, as I need to 
distinguish between 0-valued i64 fields and absent i64 fields.

Thanks again!

> IsSet* broken in Go
> -------------------
>
>                 Key: THRIFT-2232
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2232
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>            Reporter: Ben Sigelman
>              Labels: isset
>             Fix For: 0.9.2
>
>
> The various generated IsSetXYZ() methods just check for magic values of their 
> respective fields. This is obviously broken, and also diverges from the 
> implementation in other languages.
> I am willing and able to fix this myself, but I don't want to start on any 
> impl until we can decide on an approach.
> At this point, though, optional fields in Go are basically useless if one's 
> application makes use of the magic "absence" value.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to