Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Structured Type Initialization
Structured Type Initialization [message #1077328] Thu, 01 August 2013 10:43 Go to next message
Rabab Lembachar is currently offline Rabab Lembachar
Messages: 2
Registered: July 2013
Junior Member
Hello,

In Ocl, is it possible to initialize a local variable that is of a structured type?

If data type A has attributes x and y, I would like to do something like this :
let var : A = {x=1,y=2} in <expression>


Thank you in advance,
Rabab
Re: Structured Type Initialization [message #1077406 is a reply to message #1077328] Thu, 01 August 2013 12:52 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4035
Registered: July 2009
Senior Member
Hi

No.

However the Pivot-based OCL prototypes a solution re-using the type
constructor syntax.

let var : A = A{x=1,y=2} in <expression>

Regards

Ed Willink

On 01/08/2013 15:43, Rabab Lembachar wrote:
> Hello,
>
> In Ocl, is it possible to initialize a local variable that is of a
> structured type?
>
> If data type A has attributes x and y, I would like to do something
> like this :
> let var : A = {x=1,y=2} in <expression>
>
> Thank you in advance,
> Rabab
Previous Topic:[OCLinEcore] Setting Delegate (initial) => UnsupportedOperationException in dynamicSet
Next Topic:Classic OCL evaluation does not recognize additions in Standard OCL Library
Goto Forum:
  


Current Time: Fri Aug 29 14:20:38 EDT 2014

Powered by FUDForum. Page generated in 0.01641 seconds