eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[language] Introduce arbitrary element literals #1944

Open eclipse-ocl-bot opened 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 529771 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 12, 2018 15:46 EDT | | Modified | Jan 12, 2018 16:04 EDT | | See also | 388627 | | Reporter | Ed Willink |

Description

Bug 388627 identifies the need for an operation literal syntax.

OCL current supports

namespace-literals - X::Y\ enumeration-literals - X::Y\ property-literals - X::n\ template-parameters - X::T

But no operation literals.

Ideally we would have distionctive punctuation such as #x(), but that diferrs from the rest of the language. Perhaps just a type signature is adequate. Perhaps OclVoid is needed to identify no arguments.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Jan 12, 2018 15:51

For a long time C++ attempted to deduce type/non-type usage automatically. Eventually a "type" keyword was introduced. Arbitrary literals risk exactly the same problem.

"type" is not a great prefix and not a good new keyword. Perhaps "literal".

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Jan 12, 2018 16:04

(In reply to Ed Willink from comment #1)

Perhaps "literal".

Consider in the context of "typeof" and lambda literals.