3 ms·
Because unlike js, ruby chose to use {x, y} as the set literal.
by alex_smart 5y ago
Because unlike js, ruby chose to use {x, y} as the set literal.
- tinco 5y agoOhh since when is that? I've never seen or used that syntax and I sort of like it.
- alex_smart 5y agoSorry I found this page on Google but did not read the note on top. Looks like it was a proposed feature but was not implemented. https://dev.to/baweaver/ruby-3-set-literal-3fp9 https://dev.to/baweaver/ruby-3-set-literal-3fp9 Unfortunately it looks like I can't edit or delete that comment now. :embarassed:
- nauticacom 5y agoThis isn't true; Ruby has no set literal. Sets are provided by a default gem but there is no built-in syntax for them.
- alex_smart 5y agoSorry I found this page on Google but did not read the note on top. Looks like it was a proposed feature but was not implemented. https://dev.to/baweaver/ruby-3-set-literal-3fp9 https://dev.to/baweaver/ruby-3-set-literal-3fp9