-
Incidentally 1..10 is an inclusive list including the upper bound and 1...10 is exclusive (not including the 10) like Ruby.
-
Hmm, that doesn't seem to work for my version (1.0-beta-2):
groovy< 1..10
groovy<
[1, 2, 3, 4, 5, 6, 7, 8, 9]
groovy< 1...10
groovy< [lots of errors]
Maybe there's a newer version around that supports this, I don't know.
Actually, I was hoping you wouldn't copy the .. vs ... thing from Ruby, since it's terribly non-intuitive. Oh well... :-)
-
(wrong HTML escape character, but you get the idea...)
-
This is a recent change in CVS. It'll make it into the beta-3 release later this week.
FWIW at least supporting both inclusive & exclusive ranges avoids arguments over whether ranges should be inclusive or exclusive :)