Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
On 5/28/07, Chris vanBuskirk <Chris.vanBuskirk@vanderbilt.edu> wrote:
>>> Sure, there is an easy workaround, but isn't lack of
>>> support for two-param closures in find() a true-blue bug?
>>
>> I think we can do map.each
, so to be consistent,
>> perhaps we should also allow find to work that way too.
>>
> Shall I file a bug/improvement request?
GUILLAUME: "Yup: feature request or improvement."
=== HERE's WHAT I MEAN: ===
def map = ['one':1, 'two':2, 'three':3]
map.each
println map.findAll
{key,value -> key=='two'}println map.find { it.key=='two'}
println map.find {key,value -> key=='two'}