found this on a blog : (def x ^{:type ::my-class} {})
apparently it adds meta data to a map
user=> (meta x)
{:type :user/my-class}
what else does ^
do ? does it have any other uses ? can it be used as a getter for meta data (not just to set meta data) ?
how can i find out information about some shortcuts in clojure ? like ^
, '
, `
, ~
. is it possible to get that from the repl ?
Look at the documentation for the Clojure reader, specifically the section on macro characters:
The Reader
Edit: Metadata has documentation too :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With