G
gwtmp01
Mauricio Fernandez writes in http://eigenclass.org/hiki.rb?Changes+in
+Ruby+1.9+update+5
that Ruby 1.9 Head has changed Array#to_s to be an alias for
Array#to_inspect.
What is the motivation for that change?
print a
becomes
a.each { |x| print x }
It seems like an unnecessary change that takes away a very nice
default behavior.
I have a situation where I represent a tree of objects as nested
arrays. I can convert the
entire tree to a string via a pre-order traversal as:
text = tree.to_s
I like that.
Gary Wright
+Ruby+1.9+update+5
that Ruby 1.9 Head has changed Array#to_s to be an alias for
Array#to_inspect.
What is the motivation for that change?
print a
becomes
a.each { |x| print x }
It seems like an unnecessary change that takes away a very nice
default behavior.
I have a situation where I represent a tree of objects as nested
arrays. I can convert the
entire tree to a string via a pre-order traversal as:
text = tree.to_s
I like that.
Gary Wright