OCL 2.1 RTF Avatar
  1. OMG Issue

OCL21 — Add a generic text formatter operator '%

  • Key: OCL21-217
  • Legacy Issue Number: 6894
  • Status: closed  
  • Source: France Telecom R&D ( Mariano Belaunde)
  • Summary:

    Example: self.comment = "My name is %s" % self.firstname

  • Reported: OCL 2.0b2 — Wed, 7 Jan 2004 05:00 GMT
  • Disposition: Resolved — OCL 2.1
  • Disposition Summary:

    Presumably the suggestion is to build C's printf into OCL.
    However experience with printf has shown that it has significant type safety issues.
    I think a better solution requiring no change to the OCL language would be a String::printf() Standard Library operation.
    'My name is %s'.printf(self.firstname)
    Disposition: Closed, no change

  • Updated: Fri, 6 Mar 2015 20:58 GMT