Thin clojure wrapper for zeromq
Hi All, For a little hobby project I found myself looking for a clojure wrapper for 0MQ. clojure-zeromq is stale and doesn't support zeromq 3.0.0 so I rolled my own: https://github.com/AndreasKostler/clj-0MQ It's in a very early stage of development but most of the functionality is there. Furthermore, there are a bunch of working examples for you to play with. Any feedback is very welcome. Cheers Andreas -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN: Midje 1.3.0
Hi, I do not know if it's because i started writing directly clojure with facts but i find it really intuitive. Midje, there is a fact for that :d Thanks for your great work Antoine 2011/12/16 ronen nark...@gmail.com Joining the congrats, one of the must have tools for any Clojure project Ronen On Dec 14, 8:01 am, Denis Labaye denis.lab...@gmail.com wrote: Midje is getting better and better. Congrats! On Mon, Dec 12, 2011 at 5:41 PM, Brian Marick mar...@exampler.com wrote: Midje 1.3's most important feature is compatibility with Clojure 1.3. https://github.com/marick/Midje Midje is a test framework for Clojure that supports top-down as well as bottom-up testing, encourages readable tests, provides a smooth migration path from clojure.test, supports a balance between abstraction and concreteness, and tries to be gracious in its treatment of its user. Other major changes in 1.3 are: * Colorized output https://github.com/marick/Midje/wiki/Colorizing * Monitoring and rerunning changed files (autotest/lazytest) (under Leiningen:https://github.com/marick/Midje/wiki/Lein-midje) * Partial prerequisites (makes it easier to add new behavior to existing code) https://github.com/marick/Midje/wiki/Partial-prerequisites * Data prerequisites (avoiding overcommitment to data representation) https://github.com/marick/Midje/wiki/Data-prerequisites More here:https://github.com/marick/Midje/blob/master/HISTORY.md Thanks especially to Alex Baranosky, who did a lot of work on this release. Enjoy. - Brian Marick, Artisanal Labrador Now working athttp://path11.com Contract programming in Ruby and Clojure Occasional consulting on Agile -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Reuse of generic Clojure/ClojureScript code? Part 2
Following on from : https://groups.google.com/d/topic/clojure/IngUs2TUJV8/discussion I modified Chris Granger's cljs-watch to facilitate easy use of generic clj files as ClojureScript files. cljs-watch code is here: https://github.com/davesann/cljs-watch An example Noir project layout is here: https://github.com/davesann/generic-clojurescript-compile-example The method is similar to that outlined in my original post, using path naming conventions to distinguish jvm specific, cljs specific, and generic files. I expect that some may not like the naming conventions. There are possible alternatives to this method - but, for me, these would require changes to Leiningen to allow for multiple Clojure src directories. (multiple src directories do not seem possible at this time.) In reference to some of the other discussions I have seen, I am not a strong fan of the :generic marking in clj files. Essentially because the file has to be opened and parsed to determine whether it should be included in the build. I think that this may not be such a good idea for larger builds. I may be wrong. Let me know If you find this useful Regards Dave -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: UnsatisfiedLinkError using clojure.lang.RT/loadLibrary
It seems the JVM is unable to locate certain shared library in the path you specified. Can you see whether that .so file actually exists in that directory? This is what the VTK wiki says about this type of errors - http://www.vtk.org/Wiki/VTK/FAQ#When_I_try_to_run_my_program_with_Java-wrapped_VTK.2C_why_do_I_get_.22java.lang.UnsatisfiedLinkError:_no_vtkSomeLibraryName.22.3F Regards, BG On Sun, Dec 18, 2011 at 1:00 AM, Antonio Recio amdx6...@gmail.com wrote: When I try to load native libraries in the System ClassLoader I get an error of cannot open shared object file, and I don't know how to solve it. In linux in REPL : clojure java -Djava.library.path=/usr/local/lib/vtk-5.9/ -cp /usr/share/java/clojure.jar:/usr/local/lib/vtk-5.9/java/vtk.jar clojure.main when I execute this code : (ns project.core (:import (javax.swing JButton JFrame JPanel) (vtk vtkConeSource vtkPolyDataMapper vtkRenderWindow vtkRenderWindowInteractor vtkCamera vtkActor vtkRenderer vtkInteractorStyleTrackballCamera))) (clojure.lang.RT/loadLibrary vtkCommonJava) I obtain this error : UnsatisfiedLinkError /usr/local/lib/vtk-5.9/libvtkCommonJava.so.5.9.0: libvtkCommon.so.5.9: cannot open shared object file: No such file or directory java.lang.ClassLoader$NativeLibrary.load (ClassLoader.java:-2) -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Baishampayan Ghose b.ghose at gmail.com -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: UnsatisfiedLinkError using clojure.lang.RT/loadLibrary
java.library.path is only good for the first layer of libraries you load. Any dependent libs (like libvtkCommon.so) are loaded with the normal dynamic loading provided by the OS. So, i think there's two options: * Just use LD_LIBRARY_PATH env variable (or OS equivalent) and don't bother with java.library.path. * Make sure all the libs are loaded manually in the right order: (clojure.lang.RT/loadLibrary vtkCommon) (clojure.lang.RT/loadLibrary vtkCommonJava) Now the vtkCommon lib is already loaded before vtkCommonJava. Of course, this means you have to figure out the deps, sort them, and deal with changes over time. Good times. Hope this helps, Dave On Sun, Dec 18, 2011 at 11:20 AM, Baishampayan Ghose b.gh...@gmail.com wrote: It seems the JVM is unable to locate certain shared library in the path you specified. Can you see whether that .so file actually exists in that directory? This is what the VTK wiki says about this type of errors - http://www.vtk.org/Wiki/VTK/FAQ#When_I_try_to_run_my_program_with_Java-wrapped_VTK.2C_why_do_I_get_.22java.lang.UnsatisfiedLinkError:_no_vtkSomeLibraryName.22.3F Regards, BG On Sun, Dec 18, 2011 at 1:00 AM, Antonio Recio amdx6...@gmail.com wrote: When I try to load native libraries in the System ClassLoader I get an error of cannot open shared object file, and I don't know how to solve it. In linux in REPL : clojure java -Djava.library.path=/usr/local/lib/vtk-5.9/ -cp /usr/share/java/clojure.jar:/usr/local/lib/vtk-5.9/java/vtk.jar clojure.main when I execute this code : (ns project.core (:import (javax.swing JButton JFrame JPanel) (vtk vtkConeSource vtkPolyDataMapper vtkRenderWindow vtkRenderWindowInteractor vtkCamera vtkActor vtkRenderer vtkInteractorStyleTrackballCamera))) (clojure.lang.RT/loadLibrary vtkCommonJava) I obtain this error : UnsatisfiedLinkError /usr/local/lib/vtk-5.9/libvtkCommonJava.so.5.9.0: libvtkCommon.so.5.9: cannot open shared object file: No such file or directory java.lang.ClassLoader$NativeLibrary.load (ClassLoader.java:-2) -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Baishampayan Ghose b.ghose at gmail.com -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
defrecord based on runtime metadata?
I'm trying to define records based on meta data read in at runtime, and I'm attempting to write a function that extracts name and attrs and passes them to defrecord, but I don't understand how to dynamically create the symbol for the record name. e.g. user= (defrecord (symbol foo bar) [a b]) java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:5) Attempting to define fields in any way that I can guess at fail. e.g. user= (def fields [(symbol a)]) #'user/fields user= (defrecord foo fields) IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:487) user= (defrecord foo (var fields)) user.foo user= (user/map-foo {:a 67}) ;; funny #user.foo{:var nil, :fields nil, :a 67} Short of generating a string and calling eval on it, is this possible? -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ClojureScript: Error when calling require in repljs REPL.
I'm trying to learn ClojureScript and I get this error when calling require in the repljs REPL: (I ran these commands after cloning the git repo last night and running script/bootstrap) ./script/repljs Type: :cljs/quit to quit ClojureScript:cljs.user (+ 1 1) 2 ClojureScript:cljs.user (zero? 0) true ClojureScript:cljs.user (require '[goog.string :as gstring]) Error evaluating: (require (quote [goog.string :as gstring])) :as cljs.user.require.call(null,(new cljs.core.Vector(null, [\?'goog.string\,\?'as\,\?'gstring\])));\n org.mozilla.javascript.EcmaError: TypeError: Cannot call method call of undefined (cljs repl#3) at cljs repl:3 (anonymous) at cljs repl:3 nil ClojureScript:cljs.user Thanks in advance. -Fiel -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: defrecord based on runtime metadata?
On Sun, Dec 18, 2011 at 2:56 PM, Bill Robertson billrobertso...@gmail.com wrote: I'm trying to define records based on meta data read in at runtime, and I'm attempting to write a function that extracts name and attrs and passes them to defrecord, but I don't understand how to dynamically create the symbol for the record name. e.g. user= (defrecord (symbol foo bar) [a b]) java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:5) Attempting to define fields in any way that I can guess at fail. e.g. user= (def fields [(symbol a)]) #'user/fields user= (defrecord foo fields) IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:487) user= (defrecord foo (var fields)) user.foo user= (user/map-foo {:a 67}) ;; funny #user.foo{:var nil, :fields nil, :a 67} Short of generating a string and calling eval on it, is this possible? Sort of. For dynamic defrecording of dynamically-determined names at runtime, eval is needed, but eval operates on syntax fragments, not strings, so you don't need to muck about with strings and escaping and all that crap. Try (eval `(do (in-ns '~'foo) (defrecord ~(symbol Bar) [~'a ~'b]))) in the REPL and see what results. Note that it's actually very similar to macro writing. -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: defrecord based on runtime metadata?
On Sun, 2011-12-18 at 11:56 -0800, Bill Robertson wrote: I'm trying to define records based on meta data read in at runtime, Short of generating a string and calling eval on it, is this possible? Supposing by string you meant expression, no. https://groups.google.com/d/msg/clojure/kdAWhfBbxVc/czQ7rPRQwPsJ You may wish, however, to generate your defrecord forms in a macro instead. At that point, you may exploit the fact that previous top-level forms have already been evaluated at macro-expansion time: (defmacro my-stuff [blah] ;; I can assume that (hey you!) has been evaluated! ;; So if (hey you!) put something where I can get at it, `(defrecord ~based-on-hey-you ~@based-on...)) (hey you!) (my-stuff that-relies-on-hey-you) Remember, though, that if you AOT-compile, your generated defrecord will be based on the (hey you!) that was evaluated when compiling, not the one evaluated when loading the compiled files later. In short, my-stuff should have deterministic, repeatable results, and should therefore only rely on deterministic features of (hey you!), e.g. gensyms will break. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Error converting an example written in C++, TCL, python to clojure
On Sat, 2011-12-17 at 16:43 -0800, Antonio Recio wrote: When I tried to translate in clojure I get errors. Like what? Where is the error in my clojure code? Well, I can only guess, but for starters: ren (doto (vtkRenderer.) `ren' isn't defined, and vtkRenderer isn't in java.lang, so you won't be able to refer to either of them without more stuff around this. Same with `volume'. (- (.GetActiveCamera) (.SetFocalPoint (.GetCenter volume 0 1 2))) And why so many args to GetCenter? -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: defrecord based on runtime metadata?
Why do you want to do this? It's possible that it would improve performance if you generated loads of these records, but you would have to effectively compile your whole program at runtime in order to have the static type information needed to get the improved performance. Most of the time someone wants to do this it's some sort of misguided OOP or safety feature that they want to control what's in their hashmaps, and in those cases the answer is well stop putting stuff into your hashmaps if you don't want it getting there. On Dec 18, 11:56 am, Bill Robertson billrobertso...@gmail.com wrote: I'm trying to define records based on meta data read in at runtime, and I'm attempting to write a function that extracts name and attrs and passes them to defrecord, but I don't understand how to dynamically create the symbol for the record name. e.g. user= (defrecord (symbol foo bar) [a b]) java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:5) Attempting to define fields in any way that I can guess at fail. e.g. user= (def fields [(symbol a)]) #'user/fields user= (defrecord foo fields) IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:487) user= (defrecord foo (var fields)) user.foo user= (user/map-foo {:a 67}) ;; funny #user.foo{:var nil, :fields nil, :a 67} Short of generating a string and calling eval on it, is this possible? -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Thin clojure wrapper for zeromq
https://github.com/dysinger/zilch It is used by the Storm project which is enough of a thumbs up for me. (I've forked it also @ https://github.com/bjconlan/zilch - but I only point this to you because if you are using osx I've improved on the readme for getting a more recent version of jzmq installed via brew, i've also updated the project.clj to use clojure 1.3.0). Maybe this is a better choice? On Dec 18, 6:10 pm, Andreas Kostler andreas.koestler.le...@gmail.com wrote: Hi All, For a little hobby project I found myself looking for a clojure wrapper for 0MQ. clojure-zeromq is stale and doesn't support zeromq 3.0.0 so I rolled my own:https://github.com/AndreasKostler/clj-0MQ It's in a very early stage of development but most of the functionality is there. Furthermore, there are a bunch of working examples for you to play with. Any feedback is very welcome. Cheers Andreas -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Thin clojure wrapper for zeromq
Sorry I should have read the full mail. For some reason I read it as a question for an alternative to clojure-zeromq. Ignore my previous email. It also doesn't support zmq.3x (only 2.x series). Sorry about that, B. On Dec 18, 6:10 pm, Andreas Kostler andreas.koestler.le...@gmail.com wrote: Hi All, For a little hobby project I found myself looking for a clojure wrapper for 0MQ. clojure-zeromq is stale and doesn't support zeromq 3.0.0 so I rolled my own:https://github.com/AndreasKostler/clj-0MQ It's in a very early stage of development but most of the functionality is there. Furthermore, there are a bunch of working examples for you to play with. Any feedback is very welcome. Cheers Andreas -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript: Error when calling require in repljs REPL.
I found the answer in the clojurescript wiki under The REPL and Evaluation Environments. https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments (require x) is not supported but (ns ...) supports :require. On Dec 18, 4:23 pm, Fiel Cabral e4696wyoa63emq6w3250kiw60i4...@gmail.com wrote: I'm trying to learn ClojureScript and I get this error when calling require in the repljs REPL: (I ran these commands after cloning the git repo last night and running script/bootstrap) ./script/repljs Type: :cljs/quit to quit ClojureScript:cljs.user (+ 1 1) 2 ClojureScript:cljs.user (zero? 0) true ClojureScript:cljs.user (require '[goog.string :as gstring]) Error evaluating: (require (quote [goog.string :as gstring])) :as cljs.user.require.call(null,(new cljs.core.Vector(null, [\?'goog.string\,\?'as\,\?'gstring\])));\n org.mozilla.javascript.EcmaError: TypeError: Cannot call method call of undefined (cljs repl#3) at cljs repl:3 (anonymous) at cljs repl:3 nil ClojureScript:cljs.user Thanks in advance. -Fiel -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Thin clojure wrapper for zeromq
No worries :) Thanks for re-igniting my awareness of Storm. On 19 December 2011 11:22, bjconlan bcon...@gmail.com wrote: Sorry I should have read the full mail. For some reason I read it as a question for an alternative to clojure-zeromq. Ignore my previous email. It also doesn't support zmq.3x (only 2.x series). Sorry about that, B. On Dec 18, 6:10 pm, Andreas Kostler andreas.koestler.le...@gmail.com wrote: Hi All, For a little hobby project I found myself looking for a clojure wrapper for 0MQ. clojure-zeromq is stale and doesn't support zeromq 3.0.0 so I rolled my own:https://github.com/AndreasKostler/clj-0MQ It's in a very early stage of development but most of the functionality is there. Furthermore, there are a bunch of working examples for you to play with. Any feedback is very welcome. Cheers Andreas -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojurescript: how do i copy one input text field to another?
I had this problem too. I tried to do it in Pinot+Noir. Haven't figured it out yet, so curious to see if there's any success with this! On Dec 16, 1:05 pm, bob rditm...@gmail.com wrote: here is a link to both:https://gist.github.com/1487157 (hopefully that is what you meant by create a paste. first time trying it) On Dec 16, 10:29 am, David Nolen dnolen.li...@gmail.com wrote: Can you create a paste of your index.html as well as your ClojureScript file? Thanks! David On Thu, Dec 15, 2011 at 5:12 PM, bob rditm...@gmail.com wrote: I new to clojurescript and i thought i would take a simple example likehttp://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onclick it has javascript that does the following: button onclick=document.getElementById('field2').value=document.getElementById('field1').valueCopy Text/button i created the following clojurescript (defn ^:export copytext [] (let [e (dom/getElement field2)] (doto e (dom/setTextContent (.value (dom/getElement field1)) to set the input text field2. I'm not seeing any errors on the console, but i'm also not seeing the text being copied from field1 to field2. thanks in advance for pointers on how to get this working. -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- 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 your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en