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

From: Yukihiro Matsumoto <matz@...>
Date: 2008-08-04 07:51:00 UTC
List: ruby-core #18116
Hi,

In message "Re: [ruby-core:18115] Re: New array methods cycle, choice, shuffle (plus bug in cycle)"
    on Mon, 4 Aug 2008 16:08:17 +0900, gdefty@attglobal.net writes:

|on Mon, August 04, 2008, Yukihiro Matsumoto writes:
|
|| I am against #sample!, because
||  * #sample! is not the receiver modifying version of #sample.
|
|Maybe I have misunderstood, but my understanding
|of #sample! is that it DOES modify the receiver
|(i.e. the array, by deleting the elements
|returned) and is otherwise functionally identical
|to #sample. I would have thought that was a
|receiver-modifying version of #sample.

Basic rule of bang methods for strings and arrays are modifying
receivers in-place instead of modifying the copies, i.e.  Array#sort
returns an sorted (copied) array, whereas Array#sort! sorts the
receiver in-place.  They does same thing, only differs in targets.

You Array#sample! does pick samples from array, IN ADDITION TO
removing picked elements from the receiver.  Array#sample! does two
things at once.

							matz.

In This Thread

Prev Next