[This message was posted by Steve Wilkinson of Cornerstone Technology Limited <ste...@cornerstonetechnology.com> to the "Algorithmic Trading" discussion forum at http://fixprotocol.org/discuss/31. You can reply to it on-line at http://fixprotocol.org/discuss/read/dd5a2cd7 - PLEASE DO NOT REPLY BY MAIL.]
Sergey - I would strongly support Greg's viewpoint, that XOR is a two-operand-only operator. Whilst it's possible that some implementers may disagree, the likelihood that all implementers will support > two operands is in my view small. For this reason, I would suggest that if you get FIXatdl with > 2 operands in an XOR clause, then you ask the author to refactor it along the lines of Greg's suggestion. I accept that the syntax is far from elegant, but I believe it is the only safe approach across such a potentially wide range of implementations. Hope this helps - Steve. > > According to the FIXatdl-1.1 spec: ".. the logical operators, AND and > OR, can have more than two operands. Furthermore, they both perform short- > circuit evaluation of their operands. That being the case, it is > important that XML parsing or binding libraries maintain the order of > the elements as they appear; otherwise unexpected results may occur." > > But what abuot XOR? The spec doesn;t say anything about it. > > SO here is my interpetation... All logical operators are binary. > However, there is an exception for AND and OR, which can have more than > two operands (this was stricly for convenience since most programming > languages allow for this). XOR must have two and only two operands. The > operator, NOT, must have exactly one operand. > > I realize that we can get a creative and let XOR have multiple > interpretations (one and only one from a set, two and only two from a > set, three but not more than four, etc.), but that's the programmers > job, or in this case the FIXatdl author's job. > > So I think you'll need to re-write the <Edit> to something like this: > <Edit logiOperator="OR"> <Edit logicOperator="AND"> <Edit operator="EX" > field="Field1"/> <Edit operator="NX" field="Field2"/> <Edit > operator="NX" field="field3"/> </Edit> <Edit logicOperator="AND"> <Edit > operator="NX" field="Field1"/> <Edit operator="EX" field="Field2"/> > <Edit operator="NX" field="field3"/> </Edit> <Edit logicOperator="AND"> > <Edit operator="NX" field="Field1"/> <Edit operator="NX" > field="Field2"/> <Edit operator="EX" field="field3"/> </Edit> </Edit> > > -Greg [You can unsubscribe from this discussion group by sending a message to mailto:unsubscribe+100932...@fixprotocol.org] -- You received this message because you are subscribed to the Google Groups "Financial Information eXchange" group. To post to this group, send email to fix-proto...@googlegroups.com. To unsubscribe from this group, send email to fix-protocol+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fix-protocol?hl=en.