OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — Introduce a Safe Navigation Operator

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

    Languages such as Groovy have found it helpful to intrioduce the safe navigation operator ?: so that navigation over null yields null rather than a problem (invalid in OCL).

    In OCL it could be a pure syntax sugar:

    (x?.y) = (if x == null then null else x.y endif)

    or perhaps an additional PropertyCallExp operator

  • Reported: OCL 2.3.1 — Fri, 1 Mar 2013 05:00 GMT
  • Updated: Sat, 19 Jan 2019 11:40 GMT