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

James E. King, III commented on THRIFT-3190:
--------------------------------------------

I'm used to all sets being ordered because of the amount of work I've done in 
C++.  It looks like std::set<> is the only language implementation mentioned in 
the link that uses order.  The current perl implementation uses a hash with the 
key being the set value to guarantee uniqueness which is enough to satisfy the 
requirement.  Are there are set manipulation operations available 
(intersection, union, difference, and symmetric difference) that operate on a 
hash configured this way?  I would expect if someone is asking for a set<> then 
they expect the ability to use these four fundamental set manipulations.


> In perl, a thrift set<> type should be ordered and have set manipulations
> -------------------------------------------------------------------------
>
>                 Key: THRIFT-3190
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3190
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Perl - Library
>    Affects Versions: 0.9.2
>            Reporter: James E. King, III
>            Priority: Minor
>
> Currently a set<> type in Thrift equates to a hash where the value of each 
> type is set to 1.  The keys are interpreted as strings and therefore lose 
> their ordering.  The TestClient for cpp sends:
> The TestServer for perl (which I am writing to verify SSL server refactoring) 
> receives:
> $thing        HASH(0x35da228)={ -1 => '1', -2 => '1', 0 => '1', 1 => '1', 2 
> => '1' }  
> Note how -1 and -2 are transposed.  Further, there are no set manipulations 
> available.
> Recommend the use of Set::Scalar as a required perl dependency for proper set 
> operation.  This would be a breaking change but necessary to achieve proper 
> set semantics and operations from the native thrift type.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to