jastrachan | 4 Mar 15:21 2005
Picon

Re: what about sets?

On 4 Mar 2005, at 14:14, Mike Stover wrote:
> I'm a little confused - is this a suggestion for an improvement to
> Groovy, or is this an example of how it works now?

It was a suggestion of how we can work with sets and other collection 
implementations in a groovy way; its not yet implemented.

Though we have implemented array coercion...

def x= [1, 2, 3] as int[]
Customer[] customers = collection.findAll { it.name.startsWith("J") }

> On Fri, 2005-03-04 at 07:57 +0000, jastrachan@... wrote:
>> On 4 Mar 2005, at 07:52, jastrachan@... wrote:
>>> On 2 Mar 2005, at 15:26, Jeremy Rayner wrote:
>>>> I'm hoping it's something like these...
>>>>
>>>> def x = [1,2,3] as Set
>>>> def y = [4,5,6] as HashSet
>>>> Set z = [7,8,9]
>>>
>>> Looks good to me :)
>>
>> BTW we should use this to handle any collection too
>>
>> LinkedList list = [1, 2, 3]
>>
>> etc
>>
>> def y = [1, 2, 3] as SortedList
>>
>> etc
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
> -- 
> Michael Stover
> mstover@...
> AIM: mstover777
>
>

James
-------
http://radio.weblogs.com/0112098/


Gmane