elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Unique symbols

Open xiaq opened this issue 1 year ago • 1 comments

What new feature should Elvish have?

A way to create a unique symbols, like JavaScript symbols.

The main property of a symbol/keyword is that it's only equal to itself. This makes it useful for modeling domain-specific values, enums, or used as unique keys in maps.

Symbols in lisps serve a similar function but they actually behave more like interned strings. But namespaced keywords in Clojure match the desired semantics.

Output of "elvish -version"

0.21.0-dev.0.20240430145458-c7d81b20a010

Code of Conduct

xiaq avatar May 03 '24 19:05 xiaq

Weirdly I couldn't find dedicated docs for namespaced keywords on Clojure's website, but a Google search seems to give some relevant results.

xiaq avatar May 03 '24 19:05 xiaq