eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[language] Support for practical spellings of mathematical operations #430

Closed eclipse-ocl-bot closed 3 hours ago

eclipse-ocl-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 288694 | | Status | CLOSED WONTFIX | | Importance | P3 normal | | Reported | Sep 05, 2009 03:26 EDT | | Modified | May 27, 2011 02:48 EDT | | Version | 1.3.0 | | Depends on | 288911 | | Reporter | Ed Willink |

Description

The duplicate code for Ecore and UML EvaluationEnvironment that implements the getJavaMethodFor method is useful but without foundation in any OMG Issue.

The lack of an OMG Issue should be rectified, requiring the whole issue to be addressed so that the concrete syntax of e.g.

def: "<"(...)

or

def: lessThan(...)

is consistent.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Sep 05, 2009 03:32

Original newgroup discussion at news://news.eclipse.org:119/1251726678.13743.40.camel@cdamus-laptop

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Sep 09, 2009 04:08

There is no problem specifying a "<" operation in UML or EMOF. I'm not sure that the UML binding should support a search for an alternative at all.

There is also no problem specifying a "<" operation in Ecore; see oclstdlib.ecore. However attempting to validate and so to code generate gives an error.

This really an Ecore code generation problem. Bug 288911 raised against EMF.

If the mapping is not in the meta-model, how can OCL be sensibly extended to specify the user's preferred spelling of "=" as equals, compareTo, ... ? It doesn't seem reasonable to raise an OMG issue for something that is an implementation rather than specification problem.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 12, 2009 02:21

Issue 14357 proposes that awkward spellings be allowed in "".

Identifying awkward spellings in Ecore remains to be resolved. Presumably since Ecore won't change to allow the awkward spelling as the "name" and because Java generation is implicit in the ability to invoke, an EAnnotation/Comment is needed to capture the model-perspective spelling. Is this an OMG issue or just an Eclipse fudge?

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 14, 2009 14:13

If an OCL programmer wants to write

a1 > a2

where > is their own overload, and their modeling tools do not support definition of an > operation, this is not an OCL problem, but a modeling tool problem.

There is however an easy workaround

def: A::_'>'(rhs : A) = greaterThan(rhs)

which the OCL programmer can put in some meta-model support document (one day OCL might support inclusion thereof).

(NB. _'>' is today's proposal for Issue 14357.)

This requires no MDT/OCL changes, though (again one day), it might be good to recognise this idiom and optionally adjust the AST to bypass the redirection.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on May 27, 2011 02:48

Closing after over 18 months in resolved state.