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

From: "Yemi I. D. Bedu" <yemi@...>
Date: 2008-08-01 18:35:50 UTC
List: ruby-core #18064
Hello,
 The only difference is that the sampling here is only possible for one
element. The distinction would be to get a specific count of random
elements back and even better to do so as a permutation rather than just
a combination. Good day.

Yemi Bedu

P&R Fasteners
325 Pierce St
Somerset, NJ 08873
732-302-3600

-----Original Message-----
From: Thomas Enebo [mailto:Thomas.Enebo@Sun.COM]=20
Sent: Friday, August 01, 2008 1:54 PM
To: ruby-core@ruby-lang.org
Subject: [ruby-core:18056] Re: New array methods cycle, choice, shuffle
(plus bug in cycle)

Jim Weirich wrote:
> On Jul 31, 2008, at 7:33 PM, Charles Oliver Nutter wrote:
>
>> choice is a noun. choose, map, select, collect, etc are imperative=20
>> verbs.
>
>
> Interesting.  I tend to prefer nouns for methods returning values and=20
> verbs for methods called mainly for side effects.  But obviously the=20
> Ruby library doesn't follow my preferred conventions. :)
>
I vote for Jim's naming conventions :)  Seriously though... Array.first=20
is a noun.  Array.choice is also a noun.  I think from a convention=20
standpoint this is ok.

It seems that most of the problem with choice is that the name does not=20
adequately describe what it returns.  So it looks strange at first=20
glance.  You could say 'random' would be a good CHOICE, but If I saw:

arr.random

I would assume a randomized array based on name.  Picking a good name is

tough.  Picking a better name is not so easy.  Array.give_me_something

If I had my way...I would remove it since it seems like Array already=20
has too many esoteric methods in it.  Isn't this method just=20
arr[rand(arr.length)]?

-Tom


In This Thread