This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-30
Channels
- # beginners (11)
- # boot (18)
- # cider (36)
- # cljs-dev (17)
- # cljsrn (5)
- # clojure (144)
- # clojure-android (4)
- # clojure-art (1)
- # clojure-brasil (1)
- # clojure-dev (5)
- # clojure-india (1)
- # clojure-russia (13)
- # clojure-spec (4)
- # clojurescript (15)
- # code-art (2)
- # cryogen (1)
- # defnpodcast (1)
- # hoplon (1)
- # leiningen (5)
- # off-topic (18)
- # om (4)
- # onyx (25)
- # parinfer (1)
- # pedestal (6)
- # portkey (1)
- # re-frame (16)
- # reagent (1)
- # uncomplicate (1)
- # unrepl (10)
- # yada (16)
aiming for a symbol's name with str
, what does the part after the @
actually describe?
> boteval.samples.scenarios$scenario_1@77fb1002
@rauh thanks, I wonder which object would that be, when this is the str
output for a clojure function
@matan It's the class object representing the function (a function is implemented as a method of a class). A symbol referring to a var is automatically dereferenced to the actual object, if you dont want that you'd have to use (var the-fn)
to get the var object
rauh: just to nitpick for a moment, a clojure function is implemented as an object (which is why we can use functions as arguments but not methods). That function implements a few methods that call the actual code in our function body, yes.
@matan each fn get's compiled to a class + method. So when you take the value of a function you'll get the object back. See: https://clojure.org/reference/java_interop#_calling_clojure_from_java