squint icon indicating copy to clipboard operation
squint copied to clipboard

Symbols

Open lilactown opened this issue 2 years ago • 4 comments

Should Clojure symbols map to Symbols, some custom type, or strings like keywords?

lilactown avatar Aug 13 '22 21:08 lilactown

Not sure yet. Let's keep this open until we can make an informed decision.

borkdude avatar Aug 13 '22 21:08 borkdude

In contrast to Clojure, Symbols in JS are identical (if created with /for and the same string). In Clojure, symbols are not interned and can care metadata. I think the are too different to map onto each other.

borkdude avatar Aug 16 '22 21:08 borkdude

@borkdude that's only if you use Symbol.for - if you use Symbol(string) it will return a new symbol value each time.

Perhaps we should wait until we figure out how we're going to handle metadata for objects and other types

lilactown avatar Aug 17 '22 14:08 lilactown

Indeed! Perhaps we can implement metadata using the protocol which uses the Symbol like you suggested.

borkdude avatar Aug 17 '22 14:08 borkdude