groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lowery, Jeff" <jef...@mavericklabel.com>
Subject Auto-generating a map key
Date Wed, 22 Jul 2015 22:39:29 GMT
Trying to find the simplest way to auto generate a map key; the best I've
come up with is:

def c=0

def map = {
   "_KEY$c++" : "foo", "_KEY$c++": "bar", ... }

Is there better?

-- Jeff

Mime
View raw message