Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique symbols #1802

Open
1 task done
xiaq opened this issue May 3, 2024 · 1 comment
Open
1 task done

Unique symbols #1802

xiaq opened this issue May 3, 2024 · 1 comment

Comments

@xiaq
Copy link
Member

xiaq commented May 3, 2024

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
Copy link
Member Author

xiaq commented May 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant