[ATL] Missing OCL language constructs [message #659280] |
Fri, 11 March 2011 19:39 |
Sebastian Messages: 11 Registered: February 2011 |
Junior Member |
|
|
Hi there,
I just noticed that in ATL it is not possible to use the "CollectionRangeCS" construct:
helper def : allDays : Sequence(Integer) = Sequence{1..31};
This is part of the OCL language (at least since 2.0 - I could not find older definition documents):
Ocl Specification from OMG | Because of the usefulness of a Sequence of consecutive Integers, there is a separate literal to create them. The elements
inside the curly brackets can be replaced by an interval specification, which consists of two expressions of type Integer,
Int-expr1 and Int-expr2, separated by '..'. This denotes all the Integers between the values of Int-expr1 and Int-expr2,
including the values of Int-expr1 and Int-expr2 themselves:
Sequence{ 1..(6 + 4) }
Sequence{ 1..10 }
-- are both identical to
Sequence{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
|
Isn't ATL supporting all OCL definitions?
But much more important to me now: How to do something like Sequence{ 1..31 } ?
For static integers it is easy of course (1, 2, 3, ...) but I would like to use integer variables to create a sequence from n to m.
Any hints appreciated.
Regards,
Sebastian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.31765 seconds