pjlewis (Paul Lewis)
04/15/2009
-
07:11 PM
Ruby
Bug #1367: flatten(0) is not consistent with flatten(), flatten(1), etc.
- =begin
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...
pjlewis (Paul Lewis)
04/09/2009
-
08:01 AM
Ruby
Bug #1367 (Closed): flatten(0) is not consistent with flatten(), flatten(1), etc.
- =begin
> a = [1, 2]
> a2 = a.flatten
> a2 << :a
> a2
=> [1, 2, :a]
> a
=> [1, 2]
> b = [3, 4]
> b2 = b.flatten 1
> b2 << :b
> b2
=> [3, 4, :b]
> b
=> [3, 4]
HOWEVER:
> c = [5, 6]
> c2 = c.flatten...
pjlewis (Paul Lewis)
Also available in: Atom
Loading...