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 14:43 Go to next message
Rabab Lembachar is currently offline Rabab LembacharFriend
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 16:52 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4184
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: Thu Dec 18 00:46:41 GMT 2014

Powered by FUDForum. Page generated in 0.01876 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software