[ruby-core:70091] [Ruby trunk - Feature #11390] Allow symbols starting with numbers

From: 0x0dea+redmine@...
Date: 2015-07-22 21:13:50 UTC
List: ruby-core #70091
Issue #11390 has been updated by D.E. Akers.


Permitting such syntax would needlessly complicate the parser for virtually no gain, and potentially break existing code that uses a numerical literal as the alternative of a non-padded ternary expression (`foo?1:2`). Just use `:'1twothree'`.

----------------------------------------
Feature #11390: Allow symbols starting with numbers
https://bugs.ruby-lang.org/issues/11390#change-53509

* Author: Sameer Deshmukh
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Currently it is not possible to create a symbol that looks like `:1twothree`.

Converting to a string and then symbolizing causes hash lookup problems and proves counter-intuitive. What's also surprising is that ruby allows symbols to start with special characters but not numbers.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next