Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I need to write (doc str) but (meta #'str)?

Why (doc str) but (meta #'str)?

In the latter one, why is the #' necessary, which isn't in the first one?

like image 371
Hanfei Sun Avatar asked Dec 13 '25 05:12

Hanfei Sun


1 Answers

doc is a macro which internally applies #' i.e var to the passed name, hence you don't need to pass the var itself to it. meta is a function and hence it needs the var itself to be passed otherwise the value of the var will get passed to it if you use just the name of the var (as done in doc)

like image 125
Ankur Avatar answered Dec 16 '25 09:12

Ankur