viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Reusable named expressions #349

Closed bergmanngabor closed 11 years ago

bergmanngabor commented 11 years ago

We could perhaps have reusable, named expressions:

expression triangle_inequality(A as java.lang.Integer, B as java.lang.Integer, C as java.lang.Integer) {
  A < B+C &&
  B < A+C &&
  C < A+B
} // type inferred as boolean -- or should we make the return type explicit?

Then use them in check expressions (later in evals) directly:

  check triangle_inequality(X,Y,Z);

Perhaps it would be also possible to use them as sub-expressions:

  check (W.endsWith(triangle_inequality(X,Y,Z).toString()));

The advantages I foresee:

Priority: low, we do not have user requests for this yet.

istvanrath commented 11 years ago

Moved to Eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=398752