Issue 15223: OCL 2.2 11.7.1 Why must + be commutative for Collection::sum() (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: Collection::sum() requires that its T::+() is commutative and associative. Associativity is necessary for predictable results. Commutativity is not necessary, most trivially for String::+ for which sum() could usefully concatenate an OrderedSet. Suggest: remove the requirement for commutativity. Resolution: Revised Text: In 11.6.3 OrderedSet and 11.6.5 Sequence add sum() : T Redefines the Collection operation to remove the requirement for the + operation to be associative and/or commutative, since the order of evaluation is well-defined by the iteration over an ordered collection. Actions taken: April 23, 2010: received issue April 25, 2011: closed issue Discussion: Yes. Introduction of String::+() as a shorthand for String::concat() makes the suggestion a natural extension, but only for OrderedCollections. No. Neither associativity nor commutativity is necessary for OrderedCollections End of Annotations:===== ronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkIFAJM00UvUnw4R/2dsb2JhbACQK4t/cb0khQsE Date: Fri, 23 Apr 2010 13:51:52 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: issues@omg.org Subject: OCL 2.2 11.7.1 Why must + be commutative for Collection::sum() X-Plusnet-Relay: e4369a002ea25dd34ebaa27f0c667839 Hi Collection::sum() requires that its T::+() is commutative and associative. Associativity is necessary for predictable results. Commutativity is not necessary, most trivially for String::+ for which sum() could usefully concatenate an OrderedSet. Suggest: remove the requirement for commutativity. Regards Ed Willink