From: "David J. Hamilton" Date: 2011-01-11T15:49:50+09:00 Subject: Re: Best way for Array#find+transform ? Excerpts from botp's message of Mon Jan 10 18:48:14 -0800 2011: > no on all. on your case, one does not need break nor return. #find > will shortcircuit and returns the first find, or nil otherwise. iow, > the ff should do, > > paths.find{|path| File.exists?(File.join(path,filename))} This is not quite what Jonas wanted. He did not want the first element for which the block evaluated to a truthy value; he wanted that element transformed, but the transformation was exactly what was needed for the test, and Jonas wanted to avoid having to write the transformation twice. See his previous example earlier in this thread where he uses find to get the value, and then has to transform (again) the result. Break was not used to achieve short circuiting, which as you note find already does, but to specify the value of the entire expression. -- med v辰nlig h辰lsning David J. Hamilton