Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure .get and its difference to get

Tags:

clojure

What is .get in clojure and what is its difference with get? I know what get does but have never seen .get before.


1 Answers

That's how you invoke a .get method of an instance/class passed as a second parameter.

Eg:

(.get foo) ;; invokes an instance method of a foo object
(.get Bar) ;; invokes a static method of a Bar class

while

(get ...) ;; invokes a clojure get function

References:

  • http://clojure.org/java_interop
like image 71
zerkms Avatar answered Aug 13 '26 15:08

zerkms