Arbitrary abbreviations in phobos considered ridiculous

Jacob Carlborg doob at me.com
Fri Mar 9 07:41:54 PST 2012


On 2012-03-09 15:39, Timon Gehr wrote:
> On 03/08/2012 10:07 PM, H. S. Teoh wrote:
>> On Thu, Mar 08, 2012 at 05:45:47PM -0300, Ary Manzana wrote:
>>> On 3/8/12 7:27 AM, Timon Gehr wrote:
>>>> On 03/08/2012 03:14 AM, Ary Manzana wrote:
>>>>> Here's something I wrote today:
>>>>>
>>>>> parent_ids = results.map{|x|
>>>>> x['_source']['parent_ids']}.flatten.uniq.compact
>>>>> Hash[Site.find(parent_ids).map{|x| [x.id, x]}]
>>>>>
>>>>> Or I could have written:
>>>>>
>>>>> Hash[
>>>>> Site.find(
>>>>> results.map{|x| x['_source']['parent_ids']}.flatten.uniq.compact
>>>>> ).map{|x| [x.id, x]}
>>>>> ]
>>>>>
>>>>> No abbreviation at all,
>>>>
>>>> uniq.
>> [...]
>>
>> And ids.
>>
>>
>> T
>>
>
> Is that in some standard library interface?

Site.find is part of ActiveRecord (part of Rails), the rest is part of 
the core (standard) library.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list