zcaudate
zcaudate

Reputation: 14258

what is the clojurescript equivalent to 'var'?

In clojure, (var some-function) and #'some-function are equivalent.

What is the clojurescript equivalent of var?

Upvotes: 1

Views: 146

Answers (1)

Mike Fikes
Mike Fikes

Reputation: 3527

ClojureScript also has var as a special form. And, in ClojureScript (var foo) and #'foo are equivalent.

Having said that, ClojureScript's var is a bit limited compared to Clojure:

Vars are not reified at runtime. When the compiler encounters the var special form it emits a Var instance reflecting compile time metadata. (This satisfies many common static use cases.)

(Taken from Differences from Clojure.)

Upvotes: 3

Related Questions