Issue 16019: OCL 2.3 Introduce a reserved OclSelf template parameter (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: Three library operations do not appear to be declarable without intuitive typing semantics. Introduction of an OclSelf template parameter that is the statically determined type of self can solve the problem. OclSelf is a reserved spelling. Classifier::allInstances(OclSelf)() : Set(OclSelf) -- set of the derived classifier OclAny::oclType(OclSelf)() : OclSelf -- my own type as statically known OclAny::oclAsSet(OclSelf)() : Set(OclSelf) -- set of my own and derived types, declared as the statically known type [oclAsSet is the currently unspecified library operation used to realise implicit object-to-set conversion] Without an OclSelf, almost any usage of these library operations must be followed by an oclAsType to the already known type. e.g. with the OCL 2.3 type system the library function is Classifier::allInstances() : Set(Classifier) and so the usage is MyType.allInstances() -- is MyType instances as a Set(Classifier) MyType.allInstances().oclAsType(Set(MyType)) -- necessary cast to statically known type Resolution: Revised Text: Actions taken: February 12, 2011: received issue Discussion: End of Annotations:===== ronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUHAP5QVk3Unw4S/2dsb2JhbACXYo4cc7lihV4E Date: Sat, 12 Feb 2011 17:25:22 +0000 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 To: issues@omg.org Subject: OCL 2.3 Introduce a reserved OclSelf template parameter Hi Three library operations do not appear to be declarable without intuitive typing semantics. Introduction of an OclSelf template parameter that is the statically determined type of self can solve the problem. OclSelf is a reserved spelling. Classifier::allInstances(OclSelf)() : Set(OclSelf) -- set of the derived classifier OclAny::oclType(OclSelf)() : OclSelf -- my own type as statically known OclAny::oclAsSet(OclSelf)() : Set(OclSelf) -- set of my own and derived types, declared as the statically known type [oclAsSet is the currently unspecified library operation used to realise implicit object-to-set conversion] Without an OclSelf, almost any usage of these library operations must be followed by an oclAsType to the already known type. e.g. with the OCL 2.3 type system the library function is Classifier::allInstances() : Set(Classifier) and so the usage is MyType.allInstances() -- is MyType instances as a Set(Classifier) MyType.allInstances().oclAsType(Set(MyType)) -- necessary cast to statically known type Regards Ed Willink