This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: Even cleaner Map, List, and Array support
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
One of my minor pet peeves with Groovy has been:
# simple list
def x = [1, 2, "three"]
# another type of list
def x = new LinkedList()
x
...
And it is also annoying to have a different way to setup a Java Array:
int x = new int[] { .... }
Why not unify this? Groovy is good about consistency, and trying to unify the models, so now maybe we will get there via:
def x = [1, 2, 3] as LinkedList
def x = [1, 2, 3] as int[]
def aMap = ['name':'value', 'n2':'val2'] as SortedMap
Much cleaner!