[#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:18075] Re: New array methods cycle, choice, shuffle (plus bug in cycle)

From: Dave Thomas <dave@...>
Date: 2008-08-01 23:15:18 UTC
List: ruby-core #18075
On Aug 1, 2008, at 4:43 PM, David Flanagan wrote:

> If we agree that there is a use-case for adding #sample to the API,  
> then
> I would also argue again for #sample! which removes the sampled  
> elements from the array.  There is no way to write #sample! based on  
> #sample and I'd imagine that it would be usefule.
>
> If the method doesn't take an argument and always returns a single  
> element, then I'd prefer #rand or #random_element (or just removing  
> the method) to #choose or #sample.

I kinda worry that all this is leading to a bigger API than we need.  
If I wanted to pick random elements from an array, I'd just do

source = original.shuffle

and then pop, unshift, or take(n). Do we really need a separate API  
for this?



Dave



In This Thread