groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Les Hartzman <lhartz...@gmail.com>
Subject Re: Iterate over 2 lists in a closure?
Date Thu, 01 Oct 2015 17:42:13 GMT
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