Using @ alone

2015-05-20 Thread Pierre Thibault
Is possible to use the operator '@' alone? In the Joy Of Clojure book it is presented as '~@'. I would like an example. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from

Accessing static fields

2015-05-20 Thread Pierre Thibault
I can do Math/PI put how can I access PI if Math is in a expression like '(Math) for example? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated

Re: Using @ alone

2015-05-20 Thread Pierre Thibault
For example: (def foo '(1 2 3)) (+ @foo) Does not work. I am expecting 6. Le mercredi 20 mai 2015 18:37:05 UTC-4, Colin Yates a écrit : > > @my-atom is the same as (deref my-atom), is that what you mean? > On 20 May 2015 23:35, "Pierre Thibault" > wrote: > >

Re: Using @ alone

2015-05-20 Thread Pierre Thibault
OK, ~@ is one operator, I thought it was two different operators. Thank you. Le mercredi 20 mai 2015 18:38:50 UTC-4, Laurens Van Houtven a écrit : > > Hi Pierre, > > > On May 20, 2015, at 3:35 PM, Pierre Thibault > wrote: > > Is possible to use the operator '@&

Re: Accessing static fields

2015-05-20 Thread Pierre Thibault
ects. Le mercredi 20 mai 2015 18:40:13 UTC-4, Laurens Van Houtven a écrit : > > Hi Pierre, > > On May 20, 2015, at 3:38 PM, Pierre Thibault > wrote: > > I can do Math/PI put how can I access PI if Math is in a expression like > '(Math) for example? > > > Can

Re: Accessing static fields

2015-05-20 Thread Pierre Thibault
I gave it a try: (.. (class String) (getMethod "format" (into-array Class [String (Class/forName "[Ljava.lang.Object;")]))) But I am unable to get the method. I gave up. Le mercredi 20 mai 2015 19:12:05 UTC-4, Pierre Thibault a écrit : > > Hi Laurens, > > My

Re: Using @ alone

2015-05-20 Thread Pierre Thibault
ifferent thing > entirely and is used to desplice lists in a macro. > > In your example, you aren't in a macro and '() is defining a set, I.e. it > isn't a temperal construct. > On 20 May 2015 23:43, "Pierre Thibault" > wrote: > >> For example: >>

Re: Using @ alone

2015-05-20 Thread Pierre Thibault
are used to dereference constructs which support multiple >>> values over time; atoms, futures and promises etc. ~@ is a different thing >>> entirely and is used to desplice lists in a macro. >>> >>> In your example, you aren't in a macro and '() is def

Re: Accessing static fields

2015-05-20 Thread Pierre Thibault
; user => (eval `(. ~(resolve (symbol "String")) ~(symbol "format") "%s" >> (to-array ["adasd"]))) >> “adasd" >> >> Maybe a macro of some sort? >> >> (defmacro invoke-static >> [c meth & args]

Re: Using @ alone

2015-05-20 Thread Pierre Thibault
d do in a macro. You are probably looking for apply. > > For example: > > (apply + '(1 2 3)) > 6 > > > On Wednesday, May 20, 2015 at 6:07:13 PM UTC-6, Pierre Thibault wrote: >> >> No: >> >> (type '()) >> clojure.lang.PersistentList$Emp

Re: Accessing static fields

2015-05-20 Thread Pierre Thibault
me_ is pretty simple, > and is the most common case I have seen. > > Why do you think it is supposed to be simple to select Java methods based > upon the values of variables at run time? > > Andy > > On Wed, May 20, 2015 at 7:31 PM, Pierre Thibault > wrote: > >>

Re: Accessing static fields

2015-05-21 Thread Pierre Thibault
meone really thought about newbie experience. A newbie experience in > Clojure is not so pleasant. > > But Clojure is no harder, it's different - you need to start thinking a > bit differently than in Python. > > Martin > > On Thursday, 21 May 2015 05:49:31 UTC+2, Pierre

Re: Neighbors function from The Joy of Clojure

2014-11-04 Thread Pierre Thibault
Ouch! I found this code hard to understand. I read to previous part of the book. I guess it is normal when you are new to Clojure? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that