groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Rubel <oru...@gmail.com>
Subject Re: Iterate over 2 lists in a closure?
Date Thu, 01 Oct 2015 17:47:36 GMT
there ya go. :)

Owen Rubel
415-971-0976
orubel@gmail.com

On Thu, Oct 1, 2015 at 10:42 AM, Les Hartzman <lhartzman@gmail.com> wrote:

> Thanks. I also just discovered:  list1.equals(list2).
>
> On Thu, Oct 1, 2015 at 10:28 AM, Owen Rubel <orubel@gmail.com> wrote:
>
>> if(list1.contains(list2) && list2.contains(list1)){ true }
>>
>> Owen Rubel
>> 415-971-0976
>> orubel@gmail.com
>>
>> On Thu, Oct 1, 2015 at 10:22 AM, Les Hartzman <lhartzman@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I want to know if it's possible to have a closure that can iterate over
>>> 2 equal length lists? The equivalent of doing list1.each, list2.each { ...
>>> }, where each list is a list of an user-defined type.
>>>
>>> Basically I want to compare elements in the lists to see if they are
>>> equal.
>>>
>>> Thanks.
>>>
>>> Les
>>>
>>>
>>
>

Mime
View raw message