J
John Mair
Is there a good reason why Symbols are not implictly converted to
Strings ?
The following does not work for example:
evalself) #=> Error: can't convert Symbol to String
But if we do the following:
class Symbol
def to_str
to_s
end
end
Then it works:
evalself) #=> main
In my opinion this implicit conversion should happen and would be
useful in some circumstances. Why isn't this supported out of the box?
John
Strings ?
The following does not work for example:
evalself) #=> Error: can't convert Symbol to String
But if we do the following:
class Symbol
def to_str
to_s
end
end
Then it works:
evalself) #=> main
In my opinion this implicit conversion should happen and would be
useful in some circumstances. Why isn't this supported out of the box?
John