You can just replace the bounds with variables.

def a =3D 1
def b =3D 10
def r =3D= a..b

Isn't that what you're looking for?<= /div>

Guillaume

Le=C2=A0mercredi 20 av= ril 2016, Gerald Wiltse <jerryw= iltse@gmail.com> a =C3=A9crit=C2=A0:
I can find no examples of different ways to create= a range.=C2=A0 There's a plethora of examples on what you can do when = you start by creating a range like so: =C2=A0"1..10"
But, how does one create a range when the min and max values a= re stored in variables?=C2=A0 There's no range constructor.=C2=A0 I see= that it's a form of a list, but I see no helper methods for dynamicall= y creating ranges given a min and max value.=C2=A0

I even tried to get really fancy, but this evaluates to a string.=C2=A0

def=C2=A0v=C2=A0=3D=C2=A0"10..15"
assert=C2=A0Eval.x(v,=C2=A0"return x")=E2=80=8B.getC= lass()=E2=80=8B.name=C2=A0=3D=3D=C2=A0"=E2=80=8B=E2=80=8B=E2=80=8B=E2=80=8B=E2=80=8B=E2= =80=8B=E2=80=8B=E2=80=8B=E2=80=8B=E2=80=8B=E2=80=8Bjava.lang.String"=E2=80=8B

My use case is this.=C2=A0 I populate a bunch o= f form fields with variable definitions... but they all get passed to my co= de as strings. But I want to pass port ranges and lists and maps. So, the E= val() method is exactly what I needed.. it just isn't working for range= s.=C2=A0

Regards,
Jerry

Gera= ld R. Wiltse
jerrywiltse@gmail.com

=

--
Guillaume Laforge
= Apache Groovy committer & PMC Vice-President
Prod= uct Ninja & Advocate at Restlet

=

--089e011779f74cb5ba0530e3afb3--