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

From: Michael Neumann <mneumann@...>
Date: 2008-08-06 09:25:19 UTC
List: ruby-core #18143
Charles Oliver Nutter wrote:
> Brian Candler wrote:
>> If there are no good ideas left, perhaps things should be left as they 
>> are.
>> Or does that make me a heretic?
> 
> I find I frequently need to get only the second element of an array, or 
> perhaps the seventh. So perhaps if we have choice/pick/sample then we 
> should implement "second" through "tenth" as well. Maybe also powers of 
> ten beyond that... "tenth", "twentieth", "thirtieth". Maybe also 
> every_other, every_third, every_fourth so I can dice my arrays without 
> wearing _why's flip-flops.

Great idea! Why not just import the Rails code for dynamic finders into 
Ruby's Array, e.g.

   [1,2,3,4].get_second_and_third # => [2,3]

   [1,2,3,4].get_second_or_third # => [2] or [3] depending on random!!!

   [1,2,3,4].get_second_to_last # => [2,3,4]

This will produce much more readable sourcecode!!!

Regards,

   Michael

PS: I'm not serious :)


In This Thread