Re: How to get a value of a var in Java

2021-06-24 Thread Justin Smith
anyway - vars implement IFn, as far as I can see there's no real problem here, you can deref the var object and it just happens to also implement IFn (control-return adds a new line without sending in slack, but sends immediately in gmail, clearly my brain is having trouble code switching here)

Re: How to get a value of a var in Java

2021-06-24 Thread Justin Smith
(sorry, hit reply too soon) On Thu, Jun 24, 2021 at 9:42 AM Justin Smith wrote: > > Clojure vars under the IFn interface. In other words, you can only > import Clojure functions, not Clojure values, through that API. > > On Fri, Jun 18, 2021 at 12:29 PM ru wrote: > >> Thank you, Gary, for the

Re: How to get a value of a var in Java

2021-06-24 Thread Justin Smith
> Clojure vars under the IFn interface. In other words, you can only import Clojure functions, not Clojure values, through that API. On Fri, Jun 18, 2021 at 12:29 PM ru wrote: > Thank you, Gary, for the comprehensive answer. I have a control over > Clojure side, so I decide to add special

Re: How to get a value of a var in Java

2021-06-18 Thread ru
Thank you, Gary, for the comprehensive answer. I have a control over Clojure side, so I decide to add special functions to get values of needed vars. Thanks to all for the help. Best regards, Ru пятница, 18 июня 2021 г. в 20:23:31 UTC+3, gary.ve...@gmail.com: > The official Clojure API for

Re: How to get a value of a var in Java

2021-06-18 Thread Gary Verhaegen
The official Clojure API for Java is defined here and only supports importing Clojure vars under the IFn interface. In other words, you can only import Clojure functions, not Clojure values, through that API. What you are

Re: How to get a value of a var in Java

2021-06-18 Thread ru
Can you please rewrite your example in Java, that I can try it? By the way, can you give a reference on javadoc in witch IDeref class documented? Thanks in advance. пятница, 18 июня 2021 г. в 16:17:36 UTC+3, ch...@techascent.com: > Vars extend IDeref so one way to get the value of a var is to

Re: How to get a value of a var in Java

2021-06-18 Thread Chris Nuernberger
Vars extend IDeref so one way to get the value of a var is to call .deref on it: user> (def a) #'user/a user> (defn ab [] 1) #'user/ab user> (.deref (clojure.lang.RT/var "user" "a")) 2 user> (.deref (clojure.lang.RT/var "user" "ab")) #function[user/ab] On Fri, Jun 18, 2021 at 7:12 AM ru

Re: How to get a value of a var in Java

2021-06-18 Thread ru
Thanx Alex! Alas, with defn it works, with def - not! :( пятница, 18 июня 2021 г. в 15:31:03 UTC+3, Alex Ott: > does this answer your q: > https://stackoverflow.com/questions/2181774/calling-clojure-from-java/2182608#2182608 > > ? > > On Fri, Jun 18, 2021 at 12:53 PM ru wrote: > >> Dear

Re: How to get a value of a var in Java

2021-06-18 Thread Alex Ott
does this answer your q: https://stackoverflow.com/questions/2181774/calling-clojure-from-java/2182608#2182608 ? On Fri, Jun 18, 2021 at 12:53 PM ru wrote: > Dear Clojure users and team! > Citation 1 from Clojure documentation: > > "Calling Clojure From Java.. > IFn plus =