Re: Reflective method invocation

2013-06-11 Thread N8Dawgrr
ing method if several are found. > > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L70 > > It's probably worth testing this out though. > > Thanks, > Ambrose > > > On Tue, Jun 11, 2013 at 9:24 PM, N8Dawgrr > > wrote: &g

Reflective method invocation

2013-06-11 Thread N8Dawgrr
Hi All, I have a question regarding ambiguity in reflective dynamic invocation. In Clojure you can dynamically invoke a method on a Java class like so: (. some-instance bar arg) where bar is a method name. If the type inferencer can't ascertain the type of some-instance a runtime reflective p

defrecord and map

2013-03-24 Thread N8Dawgrr
Hi, I'm transforming a recursive form structure to an equivalent structure represented by Clojure records. I want polymorphic dispatch across my newly created structure of records. I also want to be able to apply a function to transform the structure of records, in much the same way as say clo

Re: Puzzle with lazy sequences

2013-02-05 Thread N8Dawgrr
coll to nil > before calling reduce in test1, because the compiler can prove it won't be > used afterwards. > In test2, coll has to be retained, because reduce is called a second time > on it. > > > 2013/2/5 N8Dawgrr > > >> If the head is retained on a lazy sequence

Puzzle with lazy sequences

2013-02-05 Thread N8Dawgrr
If the head is retained on a lazy sequence we have a potential memory leak. I set my JVM memory low, 64mb and ran the following: user> (defn test1 [coll] (reduce + coll)) #'user/test1 user> (test1 (take 1000 (iterate inc 0))) 499500 user> Now if we do: user> (defn test2 [coll] [(re

Object identity and with-meta

2012-11-23 Thread N8Dawgrr
I have unexplained behavior for with-meta. As far as I understand with-meta should not alter object identity. E.g. if we have the (= a b) => true for some a and b then (= (with-meta a ma) (with-meta b mb)) => true should also hold for any ma and mb. So why do I get the following behavior at th

Consuming web services in Clojure

2012-11-05 Thread N8Dawgrr
Hi All, Does anyone know of a good simple library to call/consume web-services from Clojure? Note I don't want to create a web-service just call one. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: bug in clojure.lang.ASeq

2012-10-10 Thread N8Dawgrr
I don't think that's a realistic option for me. I have java objects embedded in the Clojure forms, and the graph is pretty big. On Wednesday, October 10, 2012 2:02:45 PM UTC+1, Stuart Sierra wrote: > > I would recommend serializing as strings via pr/read over Java > serialization, but this still

bug in clojure.lang.ASeq

2012-10-10 Thread N8Dawgrr
Hi, stumbled on a nasty bug in Clojure. I'm transferring Clojure objects around using java serialization. When de-serializing a List (clojure.lang.ASeq) it has a hashCode of 0. This means lookups for the object in HashMaps PersistentHashMaps HashSets etc fail. The pre-serialized version of the

Re: Idea around SCMs and Clojure

2012-07-17 Thread N8Dawgrr
40:09 PM UTC+1, Tassilo Horn wrote: > > N8Dawgrr writes: > > > http://clojurian.blogspot.co.uk/ > > > > In a nutshell its about why use files for source in Clojure, can we do > > better? > > Interesting thoughts. With a dynamic, interactive language like

Idea around SCMs and Clojure

2012-07-17 Thread N8Dawgrr
Hi All, One of my first posts to Clojure mailing list. I had an idea around SCMs and Clojure. I'd basically like to put the idea out there and get some feedback. I hope I'm not breaking any etiquette linking to my blog post but I've outlined the idea here: http://clojurian.blogspot.co.uk/ In

Re: eval seq of forms in another ns

2012-03-24 Thread N8Dawgrr
If I remember rightly I solved this by binding *ns* before the eval, e.g. (binding [*ns* some-namespace] (eval form)) On Saturday, March 24, 2012 5:12:29 PM UTC, Renat Yuldashev wrote: > > How to evaluate each form from the vector of forms inside of the different > namespace? > I want to have

How to submit clojure bug report?

2012-02-29 Thread N8Dawgrr
I found a bug in Clojure core, and know its solution, question is how to submit a bug report? FYI here is the bug: => (.withMeta list {:a 1}) # This is reporducable in Clojure 1.2 and Clojure 1.3 This cause of this issue is in: svn/trunk/src/jvm/clojure/lang/PersistentList.java with the stati

Re: Odd error evaling

2011-12-03 Thread N8Dawgrr
Ok not to worry, my environment was bust, a repl restart sorted the issue. On Dec 2, 11:27 pm, N8Dawgrr wrote: > Hi Clojurians, > > I hit the following error today. My environment is Clojure 1.3 > > (eval (read-string (clojure.repl/source-fn 'keep-indexed))) > > # $In

Odd error evaling

2011-12-02 Thread N8Dawgrr
Hi Clojurians, I hit the following error today. My environment is Clojure 1.3 (eval (read-string (clojure.repl/source-fn 'keep-indexed))) # Do other people get the same exception? If so what am I doing wrong? Regards Nathan -- You received this message because you are subscribed to the Goog

Adding forms to fn

2011-11-04 Thread N8Dawgrr
Hi Clojure Group, I'm new to the group, apologies if this topic has been raised before. Basically I'm wondering if there is a reason why the form used to defined a function isn't attached as meta-data to the function. Clojure is a isomorphic language and this capability would really help me out wi