[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23272] [Bug #1393] Multiple assignment does not call to_a but to_ary

From: Vincent Isambart <redmine@...>
Date: 2009-04-21 01:39:45 UTC
List: ruby-core #23272
Bug #1393: Multiple assignment does not call to_a but to_ary
http://redmine.ruby-lang.org/issues/show/1393

Author: Vincent Isambart
Status: Open, Priority: Normal
ruby -v: 1.9.1p0, 1.9.2dev (2009-04-19 trunk 23210)

In Ruby 1.9, when Ruby is expecting an array and does not get one (for example in splat arguments), it calls the to_a method on the object.
For example, if x is not an array, "y = *x" tries to call x.to_a.
However, in multiple assignments, it does not try to call to_a but to_ary.
For example, "*y = x" tries to call x.to_ary.
Should not Ruby try to call to_a in both cases? It looks like a bug to me.
Is there a particular reason this was done?


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

In This Thread

Prev Next