[#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:18417] [Bug #512] String#% behavior

From: Eero Saynatkari <redmine@...>
Date: 2008-08-28 14:50:42 UTC
List: ruby-core #18417
Issue #512 has been updated by Eero Saynatkari.


Nakada said: "It's an implementation detail"

I would disagree it is an implementation detail for the reason that Lars posted an example about and the inverse of the example is also true, if someone expects to have #to_ary called but it is not. I think perhaps we see the problem from different aspects. Am I correct in assuming that your point is that String#% always expects an Array argument (whether true Array or #to_ary)?

I suppose a third option would be to specify that the more specific conversion is attempted first (e.g. #to_s(tr) for %s, #to_i(nt) for %c etc.) and if it does not exist, #to_ary is attempted. To me it is more logical to never convert to Array when only one value is asked for to begin with.

My preference is only calling #to_ary when multiple substitutions exist, but it does not really matter which option is chosen. I do think it must be specified to behave one way or the other, even if it is the current implementation.

(In my opinion, any use of #to_ary, #to_int, etc. or even #to_a, #to_i can never be an implementation detail because it affects user code.)
----------------------------------------
http://redmine.ruby-lang.org/issues/show/512

----------------------------------------
http://redmine.ruby-lang.org

In This Thread