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

From: Rafael Crivellari Saliba Schouery <schouery@...>
Date: 2009-04-15 12:56:37 UTC
List: ruby-core #23214
I thought about that too.
I was think about other functions. sort, of course, is going to give you a
new array,
but what about functions that already knows that is not going to do
anything, like
[].reverse ?
Ruby gives you a new array, so I think this is really a bug. I want to make
a patch
for it soon, but I don't know when I will be able to.
Bye!

Rafael Schouery
VidaGeek.net


On Wed, Apr 15, 2009 at 7:11 AM, Paul Lewis <redmine@ruby-lang.org> wrote:

> 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