ruby-core

Mailing list archive

[#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:23211] [Bug #1367] flatten(0) is not consistent with flatten(), flatten(1), etc.

From: Paul Lewis <redmine@...>
Date: 2009-04-15 10:11:02 UTC
List: ruby-core #23211
Issue #1367 has been updated by Paul Lewis.


As a pro-fix argument consider what happens when the code using flatten has a dynamic depth value.  So rather than:

x = a.flatten(0)

It's something like:

x = a.flatten(depth)

To ensure that this code behaviour predictably (without this fixed) it becomes necessary to treat 0 as a special case:

depth = ???
x = (depth != 0 ? a.flatten() : a.clone())

As it works at the moment I think it violates the principle of least surprise.
http://en.wikipedia.org/wiki/Principle_of_least_surprise
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1367

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

In This Thread