Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtend] plans for list/array literals?
[Xtend] plans for list/array literals? [message #762027] Wed, 07 December 2011 12:59 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 430
Registered: July 2009
Location: Gothenburg
Senior Member
Hi,

We were about to start implementing our test suites in Groovy, but since we might move to Xtext, it's easier to use Xtend instead. One thing that I miss from Groovy is the literal lists/arrays. These make writing tests much easier.

Are there any plans to add something similar? Or maybe there are already some nifty extension methods to do that?

best regards,
Vlad
Re: [Xtend] plans for list/array literals? [message #762044 is a reply to message #762027] Wed, 07 December 2011 13:21 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 12/7/11 1:59 PM, schrieb Vlad Dumitrescu:
> Hi,
>
> We were about to start implementing our test suites in Groovy, but since
> we might move to Xtext, it's easier to use Xtend instead. One thing that
> I miss from Groovy is the literal lists/arrays. These make writing tests
> much easier.
>
> Are there any plans to add something similar? Or maybe there are already
> some nifty extension methods to do that?

Yes, they are not extension methods, but implicitly imported:

newArrayList('foo','bar','baz')
newHashSet('a','b','c')
newHashMap(1 -> 'one', 2 -> 'two')

Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: [Xtend] plans for list/array literals? [message #762047 is a reply to message #762044] Wed, 07 December 2011 13:31 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 430
Registered: July 2009
Location: Gothenburg
Senior Member
Thanks Sven!

I think this should be put on the noteworthy list, it's very helpful.

regards,
Vlad
Previous Topic:Buils xtext projects issues
Next Topic:Xtend Google Group
Goto Forum:
  


Current Time: Tue Mar 31 00:03:50 GMT 2020

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

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

Back to the top