[ruby-core:66705] [ruby-trunk - Feature #4276] Allow use of quotes in symbol syntactic sugar for hashes

From: etienne.barrie@...
Date: 2014-12-04 19:28:55 UTC
List: ruby-core #66705
Issue #4276 has been updated by =C3=89tienne Barri=C3=A9.


Hi, any reason it doesn't work with inner hashes?

```
{ foo: {} } # =3D> {:foo=3D>{}}
{ 'foo': {} }
# SyntaxError: (irb):2: syntax error, unexpected '{'
```


----------------------------------------
Feature #4276: Allow use of quotes in symbol syntactic sugar for hashes
https://bugs.ruby-lang.org/issues/4276#change-50305

* Author: Tyler Benster
* Status: Closed
* Priority: Low
* Assignee: Yukihiro Matsumoto
* Category: core
* Target version: next minor
----------------------------------------
Current syntactic sugar allows this:

    hash =3D {Alabama: "AL"}

This feature request is to also allow symbols delimited by quotes (and thus=
 able to contain a whitespace) to use an equivalent syntactic sugar:

    hash2 =3D {"Rhode Island": "RI"}




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

In This Thread

Prev Next