Can I override `.<digit>` to point at an index for an array?
问题 .<digit> means to interpret the number as a float instead of an integer. Can I override .<digit> to let it point the index in an array so that the following will work? c = [1, 2, 3, 4, 5, 6] c.0 # => 1 c.3 # => 4 回答1: No. A method name can't begin with a number in Ruby. More about Ruby method names restrictions here. 回答2: No you can't. That is part of the literal expression for floats. It is not a method call. It is not done at Ruby syntax level. 回答3: As the other answers already told, it is