Browsing index pages (2 articles)
↧
Accessing a function bound to a var in clojure
So if I understand this correctly, when I write:(defn foo [x] (+ (* (- x 3) 2) (- x 3)))foo gets bound to:(fn [x] (+ (* (- x 3) 2) (- x 3)))How do I access the function from foo? My intention is to...
View ArticleAnswer by Michiel Borkent for Accessing a function bound to a var in clojure
If you want to use the function value stored in the Var foo, just write foo, for example:(def foo2 (comp - foo))(foo 4) ;;=> 3(foo2 4) ;;=> -3There is no special deref notation for Vars: just use...
View Article
Browsing index pages (2 articles)