elves/elvish

Unique symbols

xiaq opened this issue · 1 comments

xiaq commented

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 commented

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