[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

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

From: gwelch925@...
Date: 2015-08-14 05:23:28 UTC
List: ruby-core #70378
Issue #11390 has been updated by Grant Welch.


Sameer Deshmukh wrote:
> 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.

The non-quoted symbol format follows the same naming rules as variables (local, instance, class, global), methods, and constants (Modules, Classes, and Constants). Otherwise, you'll have to resort to the quoted string format.

Also, notice that:
~~~
:foo == :'foo' # => true
~~~

Variable and Method Naming Rules: http://ruby-doc.org/core-2.2.2/doc/syntax/assignment_rdoc.html

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

* Author: Sameer Deshmukh
* Status: Open
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
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