You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/02/16 19:03:28 UTC

[jira] Issue Comment Edited: (THRIFT-697) Union support in Ruby

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

Bryan Duxbury edited comment on THRIFT-697 at 2/16/10 6:03 PM:
---------------------------------------------------------------

{quote}
 struct_union.rb
I know it was moved from before, but is there a reason each_field needs to exist? Seems like a needless sort/copy/method call, but maybe there's a reason we were doing this that I've forgotten? If it does need to exist, is there a reason name_to_ids doesn't use it?
{quote}

each_field is the method used to do serialization. I previously changed it to make sure that it is iterated in field id order so that it will be consistently serialized with other languages. name_to_id doesn't need them in sorted order, so it iterates struct_fields on its own.

{quote}
union_spec.rb
Is there a reason you're testing that .new does't return nil? I'm not sure how to make that fail.
{quote}

This is actually a test for the == method, not for the constructor. There was a bug at some point where it wasn't checking that the other being compared to was non-nil.


      was (Author: bryanduxbury):
    bq. struct_union.rb
I know it was moved from before, but is there a reason each_field needs to exist? Seems like a needless sort/copy/method call, but maybe there's a reason we were doing this that I've forgotten? If it does need to exist, is there a reason name_to_ids doesn't use it?

each_field is the method used to do serialization. I previously changed it to make sure that it is iterated in field id order so that it will be consistently serialized with other languages. name_to_id doesn't need them in sorted order, so it iterates struct_fields on its own.

bq. union_spec.rb
Is there a reason you're testing that .new does't return nil? I'm not sure how to make that fail.

This is actually a test for the == method, not for the constructor. There was a bug at some point where it wasn't checking that the other being compared to was non-nil.

  
> Union support in Ruby
> ---------------------
>
>                 Key: THRIFT-697
>                 URL: https://issues.apache.org/jira/browse/THRIFT-697
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (Ruby), Library (Ruby)
>    Affects Versions: 0.3
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.3
>
>         Attachments: thrift-697.patch
>
>
> We'd like to have direct native support for Union-style structs in Ruby. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.