Re: [lein-cljsbuild] exclude a cljs from compilation

2012-11-15 Thread Evan Mezeske
Hi Mimmo, Unfortunately, there's no way to do that right now. I can't even think of a decent workaround (although that doesn't mean there isn't one). This is part of a more general problem, which is that each build can only have a single :source-path and is not otherwise customizable. If you

How to add the comment of a function into the compiled java class

2012-11-15 Thread Goldritter
Hi, I try add Clojure into a Java project. Therefore I write my code in Clojure and then compile the clj-File to Java classes and use these compiled classes in my Javacode. My problem is, that the commentary I wrote for the clojure function is not shown in the compiled java class or the method d

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Laurent PETIT
(map #(seq (process-some-class-instance %)) (tree-seq map? :children input)) Sent from a smartphone, please excuse the brevity/typos. Le 16 nov. 2012 à 00:13, "Hussein B." a écrit : Yes true. If it is leaf , do process-some-class-instance If it is not, then it could hold a collection o

freeing resources while generating lazy sequences

2012-11-15 Thread Alex Pooley
Hey Folks, I am writing a thin Clojure wrapper around leveldbjni https://github.com/fusesource/leveldbjni Leveldbjni provides an iterator to walk over all key, value pairs in the database. I am trying to translate this iterator functionality in to a Clojure lazy sequence. I've built my functio

Nested/inner classes with gen-class

2012-11-15 Thread Jonathan Bryant
Googled and asked on the IRC channel, but I can't find a solution. Maybe someone here can help :) I'm trying to generate nested/inner classes with gen-class. I can't just write the classes in Java because I'm generating them off of data structures declared in Clojure. For context, I'm taking

Re: Proposed change to let-> syntax

2012-11-15 Thread Mark Engelberg
On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy wrote: > The primary point of let-> is that you can insert it into an existing -> > pipeline. > > That makes sense. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: Proposed change to let-> syntax

2012-11-15 Thread Alan Malloy
The primary point of let-> is that you can insert it into an existing -> pipeline. (-> foo (stuff) (blah) (let-> foo-with-stuff (for [x foo-with-stuff] (inc x))) Your proposal breaks this. On Thursday, November 15, 2012 10:35:59 AM UTC-8, Alex Nixon wrote: > > Hi all,

Re: Difference between JVM and CLR when destructuring a lazy sequence

2012-11-15 Thread dmiller
The difference is that the JVM version is correct and the CLR implementation has a bug. I'll fix it in the current branch and try to get a patched 1.4 out as soon as I can. -- Above is all you really need to know, but I find myself forced to continue. :) -- This bug has sitting there from the

Re: Proposed change to let-> syntax

2012-11-15 Thread Alex Nixon
Thanks for the comments. Regarding the bindings, I'd point out that if-let and when-let already work this way (enforcing one binding) and so it isn't introducing any inconsistency. On 15 November 2012 23:34, Mark Engelberg wrote: > Thanks Alex. > > My two cents is that your syntax is more the w

Re: Proposed change to let-> syntax

2012-11-15 Thread Mark Engelberg
Thanks Alex. My two cents is that your syntax is more the way I'd expect it to look, starting off like an actual let with support for destructuring, followed by the forms. Only advantage I can think of for the one in core is that it enforces that you only have one binding. Basing let-> off of le

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-15 Thread Jim - FooBar();
Oops! I can use :dispose instead of :exit. If it does what it implies, it should do the job... Jim On 15/11/12 23:29, Jim - FooBar(); wrote: Wow! Unbelievable ! So there is nothing wrong with my code? After reading this thread, it seems like a serious issue...the entire repl becomes unusabl

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-15 Thread Jim - FooBar();
Wow! Unbelievable ! So there is nothing wrong with my code? After reading this thread, it seems like a serious issue...the entire repl becomes unusable which greatly limits the interactive experience. But then, what happens in Eclipse? the same principle applies? From my experience with Jav

Re: Proposed change to let-> syntax

2012-11-15 Thread Alex Nixon
For reference, the current implementation . On 15 November 2012 22:44, Andy Fingerhut wrote: > Check git commit logs from a month or so ago. Rich Hickey committed it. > > Andy > > Sent from my iPhone > > On Nov 15, 2

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Hussein B.
Yes true. If it is leaf , do process-some-class-instance If it is not, then it could hold a collection of nodes and leafs (a mixture) Actually , I'm checking tree-seq but I don't know how to use it in my case. Any ideas ? On Friday, November 16, 2012 1:06:22 AM UTC+2, lpetit wrote: > > Am I ri

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Laurent PETIT
Am I right in guessing that your input is some kind of tree where Someclass instances are leafs and non-leaf nodes are represented by maps having a :children key? Sent from a smartphone, please excuse the brevity/typos. Le 15 nov. 2012 à 23:33, "Hussein B." a écrit : Hi, Would you please help

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Hussein B.
The snippet I provided, is an idiomatic Clojure ? On Friday, November 16, 2012 12:41:31 AM UTC+2, Jay Fields wrote: > > That code is clear enough that I wouldn't feel obligated to change it > if I encountered it. > > You could also > > (defmulti crazy class) > > (defmethod crazy SomeClass [inp

Re: Proposed change to let-> syntax

2012-11-15 Thread Andy Fingerhut
Check git commit logs from a month or so ago. Rich Hickey committed it. Andy Sent from my iPhone On Nov 15, 2012, at 2:41 PM, Mark Engelberg wrote: > Where did you find the proposal? I can't find any info about let-> > > -- > You received this message because you are subscribed to the Goog

Re: code waiting on something - cannot debug - driving me insane!!!

2012-11-15 Thread Karsten Schmidt
Hi Jim, isn't that just due to the fact that closing the Swing frame kills the nrepl server JVM, but not the REPL client? Also discussed here: https://groups.google.com/forum/?fromgroups=#!topic/leiningen/QLcZIK2e5C0 I agree, it's annoying, but not sure how to workaround it? Maybe with a heartbea

Re: Proposed change to let-> syntax

2012-11-15 Thread Mark Engelberg
Where did you find the proposal? I can't find any info about let-> -- 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 - please be patient with y

Re: How to write this in idiomatic Clojure code?

2012-11-15 Thread Jay Fields
That code is clear enough that I wouldn't feel obligated to change it if I encountered it. You could also (defmulti crazy class) (defmethod crazy SomeClass [input] (seq (process-some-class-instance input)) (defmethod crazy :default [{:keys [children]}] (map crazy children)) On Thu, Nov 15,

How to write this in idiomatic Clojure code?

2012-11-15 Thread Hussein B.
Hi, Would you please help me to morph this to an idiomatic Clojure ? (defn crazy [input] (if (instance? SomeClass input) (seq (process-some-class-instance input)) (map crazy (:children input Thanks for help and time. -- You received this message because you are subsc

Re: Difference between JVM and CLR when destructuring a lazy sequence

2012-11-15 Thread Alan Malloy
Binding to [& rst] must realize an element of the sequence, to determine if there are any left, and it promises to never bind (), only nil. On Thursday, November 15, 2012 7:23:05 AM UTC-8, ffailla wrote: > > I believe I have discovered differing behavior between the JVM and CLR > implementations

Proposed change to let-> syntax

2012-11-15 Thread Alex Nixon
Hi all, I find the proposed function let-> in Clojure 1.5 very useful, but a bit ugly. The arguments are backwards when compared to vanilla let, and it doesn't support destructuring where it easily could (which I believe would be helpful when threading 'state-like' maps, as I find let-> very usef

Re: ClojureScript; How to set a field in an external JS library?

2012-11-15 Thread Thomas
Thank you Frank!!! That did the trick (DOH) Thomas On Thursday, November 15, 2012 4:40:53 PM UTC, FrankS wrote: > > Try: > > (set! (.-destinationName msg) "test-topic") > > http://himera.herokuapp.com/index.html > > -FS. > > > > On Nov 15, 2012, at 11:26 AM, Thomas > > wrote: > > > Hi, > >

Re: ClojureScript; How to set a field in an external JS library?

2012-11-15 Thread Frank Siebenlist
Try: (set! (.-destinationName msg) "test-topic") http://himera.herokuapp.com/index.html -FS. On Nov 15, 2012, at 11:26 AM, Thomas wrote: > Hi, > > I have an external JS library I want to use and I can call methods on objects > from the external library successful, but how do I set fields

Re: ClojureScript; How to set a field in an external JS library?

2012-11-15 Thread Pierre-Henry Perret
Perhaps this thread can help : javascript properties Le jeudi 15 novembre 2012 17:26:33 UTC+1, Thomas a écrit : > > Hi, > > I have an external JS library I want to use and I can call methods on > objects from the external library

ClojureScript; How to set a field in an external JS library?

2012-11-15 Thread Thomas
Hi, I have an external JS library I want to use and I can call methods on objects from the external library successful, but how do I set fields of on external library? Do I need to put this in an externs.js file? and if yes, how exactly? If I do this: (let [msg (js/Messaging.Message. "he

Difference between JVM and CLR when destructuring a lazy sequence

2012-11-15 Thread ffailla
I believe I have discovered differing behavior between the JVM and CLR implementations when running the following statement: user> (let [foo (repeatedly (fn [] (let [r (rand)] (println "in-repeat: " r) r))) [f & rst] foo] (println "return: " f)) When run on the JVM with clojure 1.4.0,

core.logic matche with maps

2012-11-15 Thread MHOOO
Hello everybody, recently I was using the following pattern a lot, in order to get access to a value inside a map: (defn map-geto* [m k v] (matche [m] ([[[k v] . _]]) ([[_ . tail]] (map-geto* tail k v I can use that like this: (run* [q] (map-geto* (seq {:

[lein-cljsbuild] exclude a cljs from compilation

2012-11-15 Thread Giacomo Cosenza
Hi all, my question is the following: - I like to have the usual brepl connect to the browser during development - I like to have the same source-base (e.g. :source-path "src/cljs") for both the development and production builds (e.g. :builds {:prod {.} {:dev {.} of :cljsbuild keyword)

Re: [ldnclj] Re: ANN: Mid November 2012 London Clojure Dojo at Forward

2012-11-15 Thread Bruce Durling
Sounds good to me. You could always write that one up on the whiteboard on Monday. ;-) cheers, Bruce On Thu, Nov 15, 2012 at 9:38 AM, Paul Lam wrote: > I'm going to tag along and tinker with Incanter in the office. Would love > some help if anyone else is interested. > > > > On Thursday, Novem

Re: ANN: Mid November 2012 London Clojure Dojo at Forward

2012-11-15 Thread Paul Lam
I'm going to tag along and tinker with Incanter in the office. Would love some help if anyone else is interested. On Thursday, November 8, 2012 9:58:28 PM UTC, Bruce Durling wrote: > > Roll up! Roll up! > > On 19 November at 7PM hosted by our friends Forward in Camden is the next > London Cloj