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

From: "Gregory Brown" <gregory.t.brown@...>
Date: 2008-08-01 00:25:39 UTC
List: ruby-core #18038
On Thu, Jul 31, 2008 at 7:50 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> Hi,
>
> In message "Re: [ruby-core:18036] Re: New array methods cycle, choice, shuffle (plus bug in cycle)"
>    on Fri, 1 Aug 2008 08:33:15 +0900, Charles Oliver Nutter <charles.nutter@sun.com> writes:
>
> |choice is a noun. choose, map, select, collect, etc are imperative
> |verbs. So choose much more consistent with the others. Also, choice
> |implies to me that it's already been made...since you can't have a
> |choice unless you've already made a "choice". In essence, a "choice" is
> |the product of "choosing" something. So ary.choose produces a choice.
>
> Interestingly Python chose "choice" for the method.  Does anyone have
> any additional info?

If feel like this sort of makes sense:

a = [1,2,3].choose

a is some element of [1,2,3] that Array has chosen for me.

But in my mind,

a = [1,2,3].choice

Doesn't seem very clear.   Mostly for the same reasons Charlie suggested.

I still think

a = [1,2,3].rand

is probably nicer.  Here I think either a is going to be some
randomized sort of the array, or it's going to be a single random
element.  In either case, after calling it once, I think I'd be able
to remember it easy enough.  I feel random_element is too verbose.

In This Thread