Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the usages for ^ and how can I get more information on it?

Tags:

clojure

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}
  1. 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) ?

  2. how can i find out information about some shortcuts in clojure ? like ^, ', `, ~. is it possible to get that from the repl ?

like image 587
Belun Avatar asked Oct 12 '10 09:10

Belun


1 Answers

Look at the documentation for the Clojure reader, specifically the section on macro characters:

The Reader

Edit: Metadata has documentation too :-)

like image 164
Michael Kohl Avatar answered Sep 23 '22 14:09

Michael Kohl