Re: How can find something inside heavily nested data structure ?

2015-08-22 Thread henrik42
I like using tree-seq and core.match when working on instaparse ASTs - like this: (require ['clojure.core.match :as 'm]) (def s [{n {id a} d 2 children [{n {id c} d 4 children nil}]} {n {id b} d 3 children nil}]) ;; top-down-traversal (defn nodes [x] (tree-seq coll? seq x)) ;; target

Re: when the body of the request is HttpInputOverHTTP, how do I get the string representation?

2015-08-22 Thread Nathaniel Young
FWIW DuckDuckGo is very good for searching software terms. The Jetty Docs were the second hit for me: https://duckduckgo.com/?q=HttpInputOverHTTP On Aug 19, 2015, at 3:57 PM, Lawrence Krubner lawre...@rollioforce.com wrote: I know this has been asked before, but Google is interpreting

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
Bingo! Everything works when I revert to clojure 1.6.0. On Saturday, August 22, 2015 at 5:49:24 PM UTC-4, William la Forge wrote: More weirdness. This works: (let [^Object aa (.seq a5)] (println (.getClass aa))) But not this: (let [^AASetSequence aa (.seq a5)] (println (.getClass

Re: Cursive and gen-class

2015-08-22 Thread Colin Fleming
That's very strange. I'd need more detailed instructions to try to reproduce this. But the class it can't find is new in Java 8 so it looks like you have a JVM version issue. I suspect that this shows up in Cursive but not in lein because you're using a different JDK version in your Cursive

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
At the moment I am dead in the water. Uninstalled cursive and now I can't reinstall. Dies after downloading. Using Java 1.7.0_65 in the IDE. Lein says: Leiningen 2.5.2 on Java 1.8.0_31 Java HotSpot(TM) 64-Bit Server VM. Going to try manually downloading cursive, if I can figure out how. On

Re: decoding clojure generated class names

2015-08-22 Thread Colin Fleming
Hi Dave, All the various stacktrace-prettifying libraries (clj-stacktrace, Aviso pretty etc) all do this - check their code out for some examples. Cheers, Colin On 23 August 2015 at 01:07, Dave Tenny dave.te...@gmail.com wrote: I wanted to write a function like this: (defn fn-name-info

Re: decoding clojure generated class names

2015-08-22 Thread Fluid Dynamics
On Saturday, August 22, 2015 at 7:28:32 PM UTC-4, Alex Miller wrote: There is a demunge function in clojure.lang.Compiler. It's not foolproof as the munging is not unambiguously reversible. If the munging process loses information, isn't there a (theoretical, at least) risk of name

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
Hi Colin! I've set it up to compile all. No doubt this will be very helpful as I will no longer need to compile using an external `lein compile`. But run still dies on the call (.getClass x), when x is a gen-class compiled class instance. On the other hand I still can not credit this as a

Re: Finding all Entities in a given partition

2015-08-22 Thread Alan Thompson
I forgot to include the GitHub link: https://github.com/cloojure/tupelo Tupelo Datomic (and the rest of the Tupelo library) is intended to make it easier more effortless to use Datomic (and Clojure in general). Enjoy! Alan On Sat, Aug 22, 2015 at 5:18 PM, Alan Thompson clooj...@gmail.com

Re: Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-22 Thread James Reeves
https://github.com/roomkey/annotate is another possibility - James On 23 August 2015 at 02:06, Colin Yates colin.ya...@gmail.com wrote: Hi Dave, it _isn't_ an Illegal argument though :-), your destructuring is simply ignoring that parameter. However, I get the pain and solutions might be

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
Set the ide to Java 8 and clojure 1.7. And now it works great. Good catch. Thanks! As for Cursive, I'm guessing it is set to be compatible with idea 14.0.x, though fortunately when you go to 14.1 the plugins get grandfathered in. Which is a bit weird! On Saturday, August 22, 2015 at 8:12:30

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
More weirdness. This works: (let [^Object aa (.seq a5)] (println (.getClass aa))) But not this: (let [^AASetSequence aa (.seq a5)] (println (.getClass aa Nor, of course, this: (let [^AASetSequence aa (.seq a5)] (println (.count aa))) Here's the error I'm getting now:

decoding clojure generated class names

2015-08-22 Thread Dave Tenny
I wanted to write a function like this: (defn fn-name-info Given a function, try to deduce the function name and clojure namespace by looking at the function's java class name and decoding stuff. Return a vector of name, namespace strings, or nil if we can't find anything. For

Fwd: Finding all Entities in a given partition

2015-08-22 Thread Alan Thompson
Hi, An email to the Datomic mailing list piqued my interest, so I have added a new funtion to the Tupelo Datomic library which allows the user to easily ( efficiently) retrieve all Entity IDs (EIDs) from a given partition (specified as a keyword). For example, suppose in our James Bond Unit Test

Re: Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-22 Thread Colin Yates
Hi Dave, it _isn't_ an Illegal argument though :-), your destructuring is simply ignoring that parameter. However, I get the pain and solutions might be (in order of 'heavyness'): - http://blog.fogus.me/2009/12/21/clojures-pre-and-post/ - https://github.com/Prismatic/schema -

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
Loving this. I had uninstalled cursive so I could reinstall. But the download of the plugin fails and when installing from disk it says cursive-14-0.1.60 is not compatible. (I'm running with idea 14.1.4.) Deleted the idea system cache, restarted, still incompatible. :-( On Saturday, August

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
Woh! I had to revert to 14.0.2 before idea accepted the clojure plugin as being compatible. On Saturday, August 22, 2015 at 8:42:42 PM UTC-4, William la Forge wrote: Loving this. I had uninstalled cursive so I could reinstall. But the download of the plugin fails and when installing from

Re: Cursive and gen-class

2015-08-22 Thread Fluid Dynamics
On Saturday, August 22, 2015 at 8:42:42 PM UTC-4, William la Forge wrote: Loving this. I had uninstalled cursive so I could reinstall. But the download of the plugin fails and when installing from disk it says cursive-14-0.1.60 is not compatible. (I'm running with idea 14.1.4.) Deleted the

Re: decoding clojure generated class names

2015-08-22 Thread Alex Miller
Yes. Specifically, - and _ both map to _ so foo-bar and foo_bar generate the same class name. So don't do that. -- 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

Re: Cursive and gen-class

2015-08-22 Thread Colin Fleming
Hi William, Right, you'll need to tell Cursive to compile that namespace in *Settings-Build, Execution, Deployment-Compiler-Clojure Compiler*. Once you've done that things should work. Cursive doesn't currently pick the set of namespaces to be compiled up from lein - it probably should. Cheers,

Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-22 Thread Dave Tenny
I sure wish Clojure would generate IllegalArgumentException in the following sample case: (defn foo [a b {:keys [c d]}] 1) (foo 1 2 :e 5) ; blithely ignores :e 5 I understand that Clojure's destructuring things are very nice, and more powerful than Common Lisp's, and I like that when I need

decoding clojure generated class names

2015-08-22 Thread Alex Miller
There is a demunge function in clojure.lang.Compiler. It's not foolproof as the munging is not unambiguously reversible. -- 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

Re: Cursive and gen-class

2015-08-22 Thread William la Forge
lean version shows java 8, but the ide sdk is java7. Didn't know they would be connected. :0 On Saturday, August 22, 2015 at 6:56:46 PM UTC-4, Colin Fleming wrote: That's very strange. I'd need more detailed instructions to try to reproduce this. But the class it can't find is new in Java 8

Cursive and gen-class

2015-08-22 Thread William la Forge
I searched and did not see anything recent on gen-class problems in Cursive. I find when I have a reference to a gen-class instance that instance? works in Cursive but .getClass does not. (Everything works with lein, of course.) What I am trying to do is to call the count method via (.count