Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I was looking at the page, I noticed that the example:

{

  key: "value",

  dr_nic: "The Comedian",

  ttl: 42
}

didn't seem to use the :symbols I know but omitted the colon.

Turns out, it somehow works:

> a = {my_key: "my_value"}

=> {:my_key=>"my_value"}

Has this always been there? It's kinda weird because that way they look like regular variables O_o



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: