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

From: "David A. Black" <dblack@...>
Date: 2008-08-07 11:45:49 UTC
List: ruby-core #18168
Hi --

On Thu, 7 Aug 2008, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: [ruby-core:18164] Re: New array methods cycle, choice, shuffle (plus bug in cycle)"
>    on Thu, 7 Aug 2008 18:35:28 +0900, gdefty@attglobal.net writes:
>
> |I have the same expectation of the order being
> |preserved. It is not because I have any particular
> |reason to preserve it, but simply because that is
> |how I would expect a reasonable implementation to
> |work.
>
> I am against #sample! for the name.  If one try to persuade me to add
> a method with the behavior, the name should be anything but #sample!
>
> |The problem with the shuffle-and-shift solutions
> |is that they do not scale well with the size of
> |the array. It is fine for small amounts of data
> |(e.g. the rock-paper-scissors example) but not how
> |I would expect a built-in method to be coded,
> |where the size of the array can not be known in
> |advance.
>
> I believe the calculation complexity of shuffle-once-and-pop is far
> lesser than pick-some-elements-and-remove-them, even with an array of
> thousands of elements.

I also agree with something I think you said before, which is that
sample! as described here seems to be doing two things. Usually the
"danger" of the bang fits very well with the receiver-changing
behavior of arrays (plus the secondary danger of the nil return). But
it's a stretch, I think, to think of a sampling as a removal
operation. It feels a bit like having first! remove the first element.


David

-- 
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