Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Using tuples(How to define tuples using let?)
[Acceleo] Using tuples [message #660955] Tue, 22 March 2011 13:48 Go to next message
Liviu  is currently offline Liviu Friend
Messages: 1
Registered: March 2011
Junior Member

I'm trying to declare Tuples, using let, like this:

[template ttt5()]
[let x : Tuple(a:Integer,b:Integer) = Tuple {a=1,b=2}]

For this example I have a syntax error, "Invalid Type Tuple(a:Integer, b:Integer).".

If, instead I try like this, with an OCL query,

[query qqq5() : Integer =
let x : Tuple(a:Integer,b:Integer) = Tuple {a=1,b=2} in

the output is as expected. Also I didn't manage to define a query returning a Tuple, and the iterate over the result of that query, for example with a for block.
Can someone explain this, and maybe give some correct examples of tuples usage?

Thanks alot,

Re: [Acceleo] Using tuples [message #661121 is a reply to message #660955] Wed, 23 March 2011 09:32 Go to previous message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Liviu,

I try to see where the problem is coming from and since I haven't found it, I have opened a bug in order to track this problem:
In the mean time, since Tuple seems to work in queries, I would recommend manipulating them only within queries.

Stephane Begaudeau Obeo,

Twitter: @sbegaudeau
Acceleo wiki:
Blogs: &
Previous Topic:[Acceleo] white lines into code and code move
Next Topic:Check Assoziation in Xtend
Goto Forum:

Current Time: Tue Nov 28 09:13:46 GMT 2023

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

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

Back to the top