[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18105] Re: New array methods cycle, choice, shuffle (plus bug in cycle)

From: Dave Thomas <dave@...>
Date: 2008-08-03 16:50:35 UTC
List: ruby-core #18105
On Aug 3, 2008, at 11:31 AM, Yukihiro Matsumoto wrote:

> Yeah, making something clean and concise is my basic source of
> decision.  Either ary.shuffle[0] or ary[rand(ary.length)] do not
> express my intention directly.

I guess I see it from both sides. It's easy to imagine hundreds of  
useful methods that can be put on arrays. If every single one was  
added, the cognitive load of learning the standard library would climb  
to the point that newcomers would be put off learning Ruby. And that's  
counter productive.

So I'm thinking that the methods that _should_ get added to the  
standard library should be the ones that are tricky to implement, or  
that have performance problems if not in C. But

class Array
   def sample
     at(rand(length))
   end
end

Doesn't seem like a lot of work to ask of a programmer.

Alternatively, perhaps all these peripheral methods could be put into  
a mixin?


Dave
  
  

In This Thread