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

From: "David A. Black" <dblack@...>
Date: 2008-08-01 19:06:36 UTC
List: ruby-core #18067
[This post is actually from trans, who asked me to forward it because
he can't reach ruby-core at the moment for gateway reasons.]

Trans writes:

The Facets library has random.rb which provides Array#at_rand, named
to reflect Array#at(index). The library also provides Array#pick(n)
which returns an array of n random elements, if n is not given then
#pick acts just like #at_rand.

I also note that a Fixnum#rand would be helpful. With it one could
almost as easily do:

   a.at(a.size.rand)

In any case, I concur that #choice is a poor choice. It just doesn't
read well at all.

T.

On Fri, 1 Aug 2008, Charles Oliver Nutter wrote:

> Michael Neumann wrote:
>> For me as a non-native English speaker, #choice is clearer.
>> For me, #choose implies that *I* have to choose something, i.e. I would
>> expect that method #choose has a parameter, which it doesn't have.
>> Whereas #choice implies, that I have no choice, which is in some sense
>> true for this method, because I can't choose the element I want.
>> 
>> So in contrast to Charles, I think, ary.choice produces a choose
>> operation internally :)
>
> I think it's pretty standard to have imperative verb methods be addressed to 
> the object in question. IO#write is telling the IO object to write something. 
> Enumerable#map is telling the Enumerable to produce a new array based on the 
> results of eaching to your block. String#split tells the array to split based 
> on your criteria. In almost all cases where a verb is specified, it's an 
> order (or message, eh?) to the object in question. Choose is the same.
>
> - Charlie
>

-- 
Rails training from David A. Black and Ruby Power and Light:
  *  Advancing With Rails    August 18-21    Edison, NJ
  * Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!

In This Thread