OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.3 Collecting elemental collections

  • Key: OCL25-8
  • Legacy Issue Number: 16348
  • Status: open  
  • Source: Model Driven Solutions ( Ed Willink)
  • Summary:

    collect and collectNested have irregular semantics that ignore the natural (outer) collection element type when used on nested collections:

    i.e Set{Set{1.0}}>collect(toString()) is Set{Set{1.0}}>collect(s : String | s.toString())

    so how might an iteration over the outer collection element type be performed?

    Presumably, for homegeneous collections, by explicitly specifying the iterator type as Set{Set{1.0}}>collect(s : Set(String) | s>size())

    Suggest: collect, collectNested specify that the implicit iterator type is the innermost collection type, and that an explicit type may
    specify a collection type that successfully iterates when all leaves of the tree are uniquely contained in a corrsponding iteration element
    of the iterator type, else the iteration is invalid.

    Can't see a solution for heterogeneous solutions

  • Reported: OCL 2.1 — Sat, 25 Jun 2011 04:00 GMT
  • Updated: Thu, 8 Oct 2015 14:11 GMT