KerML 1.0b2 FTF Avatar
  1. OMG Issue

KERML — Weird Concrete Syntax for ConditionalExpression

  • Key: KERML-193
  • Status: closed  
  • Source: itemis AG ( Dr. David Akehurst)
  • Summary:

    ConditionalExpression = 'if' ArgumentMember '?' ArgumentExpressionMember 'else' ArgumentExpressionMember ;

    e.g. if x ? y else z

    either use symbols or words.
    Not half and half!

    if x then y else z

    OR

    if x ? y : z

  • Reported: KerML 1.0b1 — Mon, 9 Oct 2023 11:35 GMT
  • Disposition: Closed; No Change — KerML 1.0b2
  • Disposition Summary:

    No change

    This was actually thoroughly discussed by the submission team. The keyword "then" is used in the notation for succession, and so cannot be used in the conditional expression notation (this is actually more problematic in SysML, which includes various textual shorthands for succession and a "conditional succession" notation that already has the form "if...then...").

    The originally proposed notation for a conditional expression was the common C notation "...?...:...". However, the feedback from modelers who were not C/Java programmers was that this was very non-intuitive. The notation "if...?..:..." was considered, but there was general agreement that it was clearer to use "else" rather than ":", even if "?" was used rather than "then".

  • Updated: Tue, 1 Jul 2025 15:01 GMT