Re: Intro to Live Programming with Overtone
Hi Devin, On 25 Apr 2011, at 00:57, Devin Walters wrote: You can get similar effects with highlight tail mode in emacs. The elisp in there might give you some ideas on how to get some of the glow effects. Oh nice, I hadn't seen highlight tail mode before. I do use eval-sexp-fu.el (http://www.emacswiki.org/emacs/EvalSexpFu) to fade the currently evaluated sexp in and out which is a similar kind of trick. The glow effect I was referring to as the Final Cut Express fx is the persistent shine you see on all the text which makes it look like a retro games console. reich-score is really impressive. Looking forward to playing with the new features. Do you mean the Reich technique or the ascii-art? The ascii-art was hand-crafted and assigned to a snippet shortcut (reich-score). I used yasnippet (http://www.emacswiki.org/emacs/Yasnippet) and the following snippet text https://github.com/overtone/live-coding-emacs/blob/master/etc/snippets/clojure-mode/reich-score If anyone else has any tips on how to make your Emacs look fun and fancy - particularly in the context of using it as a presentation tool, I'd love to hear them! Sam --- http://sam.aaron.name -- 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: Contrib.Logging enhancements: set-log-level!, spy for lazy sequences
On Apr 12, 2:46 pm, ataggart alexclojuregr...@gmail.com wrote: Providing a mechanism which is simple, and does what one expects (an open question) consistently across different backing implementations is not as easy as it may seem. Ideally, we can just cover the common base case, and expose machinery for the user to configure any non-standard situations as required. I imagine 80% of the time the logging library is used, the user is not going to be setting up any logging hierarchies of any kind. There should be a simple function that sets all logging levels to the given level to cover that 80% base case. People who need something more elaborate are going to be doing a lot of customization anyway... we don't need to cover every possible case, just the most common ones. The multiple backeds problem is indeed pretty annoying. The Clojure- level library would have to know about each and every backend and all its quirks to be able to do the right thing in every case... but isn't that the whole point of the abstraction layer? Where do we start? Are some backends more common than others? Best, Paul -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
Hi George, On 25 Apr 2011, at 00:14, George Jahad wrote: Technomancy has been kind enough to merge it into the main swank- clojure repo, so it will a part of swank-clojure releases going forward. It's very exciting that CDT is being merged with swank-clojure - great stuff! I just tried the 1.4.0-SNAPSHOT and ran into issues: Here's me using a slime REPL: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. No such var: core/swank-worker-thread-name [Thrown class java.lang.Exception] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.Compiler.resolveIn(Compiler.java:5651) 1: clojure.lang.Compiler.resolve(Compiler.java:5621) 2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584) 3: clojure.lang.Compiler.analyze(Compiler.java:5172) 4: clojure.lang.Compiler.analyze(Compiler.java:5151) 5: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057) 6: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371) 7: clojure.lang.Compiler.analyze(Compiler.java:5190) 8: clojure.lang.Compiler.analyze(Compiler.java:5151) 9: clojure.lang.Compiler$SetExpr.parse(Compiler.java:2546) 10: clojure.lang.Compiler.analyze(Compiler.java:5196) 11: clojure.lang.Compiler.access$100(Compiler.java:35) 12: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:438) 13: clojure.lang.Compiler.analyzeSeq(Compiler.java:5369) 14: clojure.lang.Compiler.analyze(Compiler.java:5190) 15: clojure.lang.Compiler.analyze(Compiler.java:5151) 16: clojure.lang.Compiler.eval(Compiler.java:5428) 17: clojure.lang.Compiler.load(Compiler.java:5857) 18: clojure.lang.RT.loadResourceScript(RT.java:340) 19: clojure.lang.RT.loadResourceScript(RT.java:331) 20: clojure.lang.RT.load(RT.java:409) 21: clojure.lang.RT.load(RT.java:381) 22: clojure.core$load$fn__4511.invoke(core.clj:4905) 23: clojure.core$load.doInvoke(core.clj:4904) 24: clojure.lang.RestFn.invoke(RestFn.java:409) 25: clojure.core$load_one.invoke(core.clj:4729) 26: clojure.core$load_lib.doInvoke(core.clj:4766) 27: clojure.lang.RestFn.applyTo(RestFn.java:143) 28: clojure.core$apply.invoke(core.clj:542) 29: clojure.core$load_libs.doInvoke(core.clj:4800) 30: clojure.lang.RestFn.applyTo(RestFn.java:138) 31: clojure.core$apply.invoke(core.clj:542) 32: clojure.core$require.doInvoke(core.clj:4869) 33: clojure.lang.RestFn.invoke(RestFn.java:458) 34: swank.core.cdt_backends$eval2627$loading__4410__auto2628.invoke(cdt_backends.clj:1) 35: swank.core.cdt_backends$eval2627.invoke(cdt_backends.clj:1) 36: clojure.lang.Compiler.eval(Compiler.java:5424) 37: clojure.lang.Compiler.eval(Compiler.java:5415) 38: clojure.lang.Compiler.load(Compiler.java:5857) 39: clojure.lang.RT.loadResourceScript(RT.java:340) 40: clojure.lang.RT.loadResourceScript(RT.java:331) 41: clojure.lang.RT.load(RT.java:409) 42: clojure.lang.RT.load(RT.java:381) 43: clojure.core$load$fn__4511.invoke(core.clj:4905) 44: clojure.core$load.doInvoke(core.clj:4904) 45: clojure.lang.RestFn.invoke(RestFn.java:409) 46: clojure.core$load_one.invoke(core.clj:4729) 47: clojure.core$load_lib.doInvoke(core.clj:4766) 48: clojure.lang.RestFn.applyTo(RestFn.java:143) 49: clojure.core$apply.invoke(core.clj:542) --more-- I'm using cake which I believe does fancy things with classloaders - perhaps this is causing an issue here too? Where would be the best place to file a bug report? Sam --- http://sam.aaron.name -- 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: New contrib releases
I have moved and released some c.c libraries into their new homes. * c.c.def and c.c.classpath are now combined under clojure.java.classpath and version 0.1.0 is available on maven central correction: c.c.def = c.c.jar * c.c.find-namespaces is now clojure.tools.namespaces. I released version 0.1.0 just a few minutes ago, so it will be a few hours before it hits maven central. You can view the build status of these projects at http://build.clojure.org -- 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: Feedback Request
Thanks. cljque looks interesting and might provide a nice abstraction for swing events. I made a little example of hooking a textbox to a ref: https://github.com/daveray/seesaw/blob/master/src/seesaw/examples/text_ref.clj Generalizing it might be tricky since data models (the stuff behind the ref) and user interactions (when should the ref be updated) vary so much. It would be easy enough, though, to have a helper function that wires together a widget and ref for simple cases. Dave On Sat, Apr 23, 2011 at 4:06 AM, pepijn (aka fliebel) pepijnde...@gmail.com wrote: Cool. Have you seen https://github.com/stuartsierra/cljque ? They might be nice to use with Swing events. I figured you could turn a string into a label, button or textbox depending on if it's wrapped in an atom, observer or not at all. But that is just more blabla, I need to make some time to look at the source and try some stuff myself. On Apr 19, 6:20 pm, Dave Ray dave...@gmail.com wrote: Thanks. At the moment Seesaw has a ToWidget protocol which it uses to implicitly convert things to Swing components (String - JLabel, Action - JButton, etc). So it should be pretty extensible beyond the default conversions that are supplied. Dave On Tue, Apr 19, 2011 at 10:41 AM, pepijn (aka fliebel) pepijnde...@gmail.com wrote: I'll look at it more closely later, but the idea of a Swing wrapper DSL is awesome. It occurred to me that Lisp is data as code, and that every object can transform itself into something printable (toString). So why don't objects support toSwing? With the aid of metadata, I'm sure it could work. On Apr 19, 12:57 am, Dave Ray dave...@gmail.com wrote: Hi, For the last few weeks, I've been working on a Clojure Swing wrapper called Seesaw. I've learned a lot about Clojure so far, but I think it's time to ask for some feedback. If I wait 'til it's perfect or complete, ... well, then no one would ever hear from me. The code can be found on github here: https://github.com/daveray/seesaw I guess I'm looking for two kinds of feedback: 1) Is something like this useful or interesting to anybody? As someone who spends a lot of time programming Swing, it's useful to me, but if some tweaks or changes would help others, I'd like to know. 2) How bad am I abusing Clojure and what could I do to improve it? It's not particularly functional, but I'm currently using Swing's insanely imperative style as an excuse for that. Thanks! 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 -- 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: Executing Future
the easiest way (i find) to test if something occurring on another thread has completed is using a latch: (deftest mohanr (let [latch (CountDownLatch. 1) service (Executors/newFixedThreadPool 10)] (doseq [x (range 1) :let [f (.submit service (proxy [Callable] [] (call [] (.countDown latch]] (is (= true (.await latch 1 TimeUnit/SECONDS)) its possible in your code the future isnt yet done, because you check immediately after submitting the task to the thread pool. hope that helps... On Mon, Apr 25, 2011 at 6:27 AM, MohanR radhakrishnan.mo...@gmail.com wrote: ( deftest teststream (def service ( Executors/newFixedThreadPool 10 )) (dotimes [x 1] (try (def futures (.submit service ( proxy [Callable][] ( call [] ( println Test ) ) ))) ( println ( str Future is done ? ( true? ( .isDone futures ) ))) (catch ExecutionException e ( .cancel futures ) ) (catch Exception e ( .cancel futures ) ) ) )) This is again a beginner's question. Why is the future not done here ? I am getting 'false' and I believe there are simple mistakes in the code. There is no exception though. -- 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
Strange error
Can anyone help me with this? I get the following error: Exception in thread main java.lang.IllegalArgumentException: Parameter declaration dosync should be a vector (jjJack.clj:22) Line 22 is the ns statement - no other error line in my program is listed. I've used dosync many times. Every one here looks correct. No parens are off. Where should I look? Bill -- 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: Clojure group in DFW area
I am interested as well and have office space in Addison near beltline and the tollway we can use. How about meeting next Monday may 2nd @ 630 pm? We can fo an organizational meeting about goals of the group, etc. On Mar 10, 8:28 am, Alex Robbins alexander.j.robb...@gmail.com wrote: Anyone else in the north Dallas area using/interested in Clojure? I'd love to get together. Alex -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
I get the same thing with just plain leiningen. It's not cake. On Apr 25, 2011, at 5:22 AM, Sam Aaron wrote: Hi George, On 25 Apr 2011, at 00:14, George Jahad wrote: Technomancy has been kind enough to merge it into the main swank- clojure repo, so it will a part of swank-clojure releases going forward. It's very exciting that CDT is being merged with swank-clojure - great stuff! I just tried the 1.4.0-SNAPSHOT and ran into issues: Here's me using a slime REPL: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. No such var: core/swank-worker-thread-name [Thrown class java.lang.Exception] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.Compiler.resolveIn(Compiler.java:5651) 1: clojure.lang.Compiler.resolve(Compiler.java:5621) 2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584) 3: clojure.lang.Compiler.analyze(Compiler.java:5172) 4: clojure.lang.Compiler.analyze(Compiler.java:5151) 5: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057) 6: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371) 7: clojure.lang.Compiler.analyze(Compiler.java:5190) 8: clojure.lang.Compiler.analyze(Compiler.java:5151) 9: clojure.lang.Compiler$SetExpr.parse(Compiler.java:2546) 10: clojure.lang.Compiler.analyze(Compiler.java:5196) 11: clojure.lang.Compiler.access$100(Compiler.java:35) 12: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:438) 13: clojure.lang.Compiler.analyzeSeq(Compiler.java:5369) 14: clojure.lang.Compiler.analyze(Compiler.java:5190) 15: clojure.lang.Compiler.analyze(Compiler.java:5151) 16: clojure.lang.Compiler.eval(Compiler.java:5428) 17: clojure.lang.Compiler.load(Compiler.java:5857) 18: clojure.lang.RT.loadResourceScript(RT.java:340) 19: clojure.lang.RT.loadResourceScript(RT.java:331) 20: clojure.lang.RT.load(RT.java:409) 21: clojure.lang.RT.load(RT.java:381) 22: clojure.core$load$fn__4511.invoke(core.clj:4905) 23: clojure.core$load.doInvoke(core.clj:4904) 24: clojure.lang.RestFn.invoke(RestFn.java:409) 25: clojure.core$load_one.invoke(core.clj:4729) 26: clojure.core$load_lib.doInvoke(core.clj:4766) 27: clojure.lang.RestFn.applyTo(RestFn.java:143) 28: clojure.core$apply.invoke(core.clj:542) 29: clojure.core$load_libs.doInvoke(core.clj:4800) 30: clojure.lang.RestFn.applyTo(RestFn.java:138) 31: clojure.core$apply.invoke(core.clj:542) 32: clojure.core$require.doInvoke(core.clj:4869) 33: clojure.lang.RestFn.invoke(RestFn.java:458) 34: swank.core.cdt_backends$eval2627$loading__4410__auto2628.invoke(cdt_backends.clj:1) 35: swank.core.cdt_backends$eval2627.invoke(cdt_backends.clj:1) 36: clojure.lang.Compiler.eval(Compiler.java:5424) 37: clojure.lang.Compiler.eval(Compiler.java:5415) 38: clojure.lang.Compiler.load(Compiler.java:5857) 39: clojure.lang.RT.loadResourceScript(RT.java:340) 40: clojure.lang.RT.loadResourceScript(RT.java:331) 41: clojure.lang.RT.load(RT.java:409) 42: clojure.lang.RT.load(RT.java:381) 43: clojure.core$load$fn__4511.invoke(core.clj:4905) 44: clojure.core$load.doInvoke(core.clj:4904) 45: clojure.lang.RestFn.invoke(RestFn.java:409) 46: clojure.core$load_one.invoke(core.clj:4729) 47: clojure.core$load_lib.doInvoke(core.clj:4766) 48: clojure.lang.RestFn.applyTo(RestFn.java:143) 49: clojure.core$apply.invoke(core.clj:542) --more-- I'm using cake which I believe does fancy things with classloaders - perhaps this is causing an issue here too? Where would be the best place to file a bug report? Sam --- http://sam.aaron.name -- 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: Strange error
It's probably a paren off, but it would be easier to tell for sure if you posted the code to a github gist, or here. On Mon, Apr 25, 2011 at 10:02 AM, WoodHacker ramsa...@comcast.net wrote: Can anyone help me with this? I get the following error: Exception in thread main java.lang.IllegalArgumentException: Parameter declaration dosync should be a vector (jjJack.clj:22) Line 22 is the ns statement - no other error line in my program is listed. I've used dosync many times. Every one here looks correct. No parens are off. Where should I look? Bill -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
strange. haven't seen that one before. can you and jeff send me your project.clj file, and a directory listing of your lib and lib/dev directories? also what operating system/version/java vm are you using? i'll have to set up a place for bug reports. haven't done so yet. On Apr 25, 2:22 am, Sam Aaron samaa...@gmail.com wrote: Hi George, On 25 Apr 2011, at 00:14, George Jahad wrote: Technomancy has been kind enough to merge it into the main swank- clojure repo, so it will a part of swank-clojure releases going forward. It's very exciting that CDT is being merged with swank-clojure - great stuff! I just tried the 1.4.0-SNAPSHOT and ran into issues: Here's me using a slime REPL: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. No such var: core/swank-worker-thread-name [Thrown class java.lang.Exception] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.Compiler.resolveIn(Compiler.java:5651) 1: clojure.lang.Compiler.resolve(Compiler.java:5621) 2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584) 3: clojure.lang.Compiler.analyze(Compiler.java:5172) 4: clojure.lang.Compiler.analyze(Compiler.java:5151) 5: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057) 6: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371) 7: clojure.lang.Compiler.analyze(Compiler.java:5190) 8: clojure.lang.Compiler.analyze(Compiler.java:5151) 9: clojure.lang.Compiler$SetExpr.parse(Compiler.java:2546) 10: clojure.lang.Compiler.analyze(Compiler.java:5196) 11: clojure.lang.Compiler.access$100(Compiler.java:35) 12: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:438) 13: clojure.lang.Compiler.analyzeSeq(Compiler.java:5369) 14: clojure.lang.Compiler.analyze(Compiler.java:5190) 15: clojure.lang.Compiler.analyze(Compiler.java:5151) 16: clojure.lang.Compiler.eval(Compiler.java:5428) 17: clojure.lang.Compiler.load(Compiler.java:5857) 18: clojure.lang.RT.loadResourceScript(RT.java:340) 19: clojure.lang.RT.loadResourceScript(RT.java:331) 20: clojure.lang.RT.load(RT.java:409) 21: clojure.lang.RT.load(RT.java:381) 22: clojure.core$load$fn__4511.invoke(core.clj:4905) 23: clojure.core$load.doInvoke(core.clj:4904) 24: clojure.lang.RestFn.invoke(RestFn.java:409) 25: clojure.core$load_one.invoke(core.clj:4729) 26: clojure.core$load_lib.doInvoke(core.clj:4766) 27: clojure.lang.RestFn.applyTo(RestFn.java:143) 28: clojure.core$apply.invoke(core.clj:542) 29: clojure.core$load_libs.doInvoke(core.clj:4800) 30: clojure.lang.RestFn.applyTo(RestFn.java:138) 31: clojure.core$apply.invoke(core.clj:542) 32: clojure.core$require.doInvoke(core.clj:4869) 33: clojure.lang.RestFn.invoke(RestFn.java:458) 34: swank.core.cdt_backends$eval2627$loading__4410__auto2628.invoke(cdt_backends.clj:1) 35: swank.core.cdt_backends$eval2627.invoke(cdt_backends.clj:1) 36: clojure.lang.Compiler.eval(Compiler.java:5424) 37: clojure.lang.Compiler.eval(Compiler.java:5415) 38: clojure.lang.Compiler.load(Compiler.java:5857) 39: clojure.lang.RT.loadResourceScript(RT.java:340) 40: clojure.lang.RT.loadResourceScript(RT.java:331) 41: clojure.lang.RT.load(RT.java:409) 42: clojure.lang.RT.load(RT.java:381) 43: clojure.core$load$fn__4511.invoke(core.clj:4905) 44: clojure.core$load.doInvoke(core.clj:4904) 45: clojure.lang.RestFn.invoke(RestFn.java:409) 46: clojure.core$load_one.invoke(core.clj:4729) 47: clojure.core$load_lib.doInvoke(core.clj:4766) 48: clojure.lang.RestFn.applyTo(RestFn.java:143) 49: clojure.core$apply.invoke(core.clj:542) --more-- I'm using cake which I believe does fancy things with classloaders - perhaps this is causing an issue here too? Where would be the best place to file a bug report? Sam ---http://sam.aaron.name -- 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: Clojure group in DFW area
That sounds good to me. On Mon, Apr 25, 2011 at 9:24 AM, ch...@rubedoinc.com ch...@rubedoinc.com wrote: I am interested as well and have office space in Addison near beltline and the tollway we can use. How about meeting next Monday may 2nd @ 630 pm? We can fo an organizational meeting about goals of the group, etc. On Mar 10, 8:28 am, Alex Robbins alexander.j.robb...@gmail.com wrote: Anyone else in the north Dallas area using/interested in Clojure? I'd love to get together. Alex -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
Hi George, I'm a bit further forward than I was before :-) On 25 Apr 2011, at 15:41, George Jahad wrote: strange. haven't seen that one before. can you and jeff send me your project.clj file, and a directory listing of your lib and lib/dev directories? also what operating system/version/java vm are you using? Here's my global cake directory - see that it has pulled in the source and cdt jars (these will be made available to all clojure projects started with cake) λ tree ~/.cake /Users/sam/.cake ├── build ├── classes ├── config ├── lib │ ├── clojure-1.2.0.jar │ ├── clojure-contrib-1.2.0.jar │ ├── clojure-source-1.2.0.jar │ ├── deps.clj │ └── dev │ ├── cdt-1.2.6.1-20110417.030036-6.jar │ ├── debug-repl-0.3.1.jar │ └── swank-clojure-1.4.0-20110417.030036-3.jar ├── pom.xml ├── project.clj ├── run └── stable_version 5 directories, 11 files the global project.clj file that pulled this stuff down is as follows: (defproject global 0.0.0 :description Don't rename this project, but you can change the version if you want. :dependencies [[clojure 1.2.0] [clojure-contrib 1.2.0] [clojure-source 1.2.0]] :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT]]) I also have a project.clj for a blank project: (defproject foo 0.0.1-SNAPSHOT :description TODO: add summary of your project :dependencies [[clojure 1.2.0]]) Notice that I don't include either swank-clojure or the jvm opts stuff here - swank-clojure is dealt with by the global project, and cake doesn't seem to honour jvm opts in the project.clj, it asks you to place them in your .cake/config: jvm.opts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n The project lib is also pretty sparse: λ ls lib clojure-1.2.0.jar deps.clj OK, with that all configured, and set up, I start a swank server and try the following: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. Clearing CDT event requests and continuing. Swank CDT release 1.4.0a started Notice how this time I'm getting the CDT starting which is further than before - this was because I had forgotten that cake requires the jvm opts in its own config file. I'm also no longer seeing that stack trace. However, I'm still seeing the tools.jar error - is this a major problem? Sam --- http://sam.aaron.name -- 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: clojure.contrib.sql = clojure.java.jdbc - looking for feedback!
We've been using iBatis (http://ibatis.apache.org/) to compose sql fragments and map to java objects. iBatis has since forked from Apache to become mybatis (http://www.mybatis.org/). With iBatis, you can use XML to attach an identifier to sql fragments. You can build up sql expressions by referencing the fragments by id and also use simple logic. The XML is cumbersome, but seemed nicer than java strings to DRY out the sql. I was wondering if c.j.jdbc could provide some help in composing sql fragments, but I'm not sure what form it should take or if core clojure would suffice. We would have looked into ClojureQL, but it doesn't directly support Oracle. Would also be curious to know how people use clojure to compose sql fragments. -- 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: clojure.contrib.sql = clojure.java.jdbc - looking for feedback!
On Mon, Apr 25, 2011 at 12:23 PM, Michael michael-a...@db.com wrote: I was wondering if c.j.jdbc could provide some help in composing sql fragments, but I'm not sure what form it should take or if core clojure would suffice. We would have looked into ClojureQL, but it doesn't directly support Oracle. Would also be curious to know how people use clojure to compose sql fragments. For Lobos I've written a compiler which transform an AST into SQL DDL statements. You can have a look at the compiler here: https://github.com/budu/lobos/blob/master/src/lobos/compiler.clj It's based on the legacy ClojureQL project, I've written some helpers but it's mostly using Clojure string facilities. So I'm not sure it would be a good idea to include such helpers inside c.j.j, outside the as-identifier function here: http://dev.clojure.org/jira/browse/CLJ-778 As for the new ClojureQL project, it would certainly be feasible to add support for Oracle, but I find it hard to work with its current simplified compiler. I've tried to add stropping to ClojureQL multiple times, but gave up in the end. -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
On Apr 25, 8:38 am, Sam Aaron samaa...@gmail.com wrote: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. Clearing CDT event requests and continuing. Swank CDT release 1.4.0a started Notice how this time I'm getting the CDT starting which is further than before - this was because I had forgotten that cake requires the jvm opts in its own config file. I'm also no longer seeing that stack trace. However, I'm still seeing the tools.jar error - is this a major problem? Can you set breakpoints and catch exceptions per the test drive in the doc? if so, you should be in business. for my reference, which os/version/ java version are you using? Also, it sounds like cake setup if significantly different and I don't know anything about Cake. If you can generalize your setup and send it to me, I'll add it to the docs. please keep me posted about any other issues you find! thanks, g -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
My problem was that I was including incanter, which depends on swank-clojure 1.3.0-snapshot, which was conflicting with 1.4. I deleted the swank-clojure 1.3 jar from 'lib' and it worked. On Apr 25, 2011, at 10:41 AM, George Jahad wrote: strange. haven't seen that one before. can you and jeff send me your project.clj file, and a directory listing of your lib and lib/dev directories? also what operating system/version/java vm are you using? i'll have to set up a place for bug reports. haven't done so yet. On Apr 25, 2:22 am, Sam Aaron samaa...@gmail.com wrote: Hi George, On 25 Apr 2011, at 00:14, George Jahad wrote: Technomancy has been kind enough to merge it into the main swank- clojure repo, so it will a part of swank-clojure releases going forward. It's very exciting that CDT is being merged with swank-clojure - great stuff! I just tried the 1.4.0-SNAPSHOT and ran into issues: Here's me using a slime REPL: user (use 'swank.cdt) warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. No such var: core/swank-worker-thread-name [Thrown class java.lang.Exception] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.Compiler.resolveIn(Compiler.java:5651) 1: clojure.lang.Compiler.resolve(Compiler.java:5621) 2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584) 3: clojure.lang.Compiler.analyze(Compiler.java:5172) 4: clojure.lang.Compiler.analyze(Compiler.java:5151) 5: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057) 6: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371) 7: clojure.lang.Compiler.analyze(Compiler.java:5190) 8: clojure.lang.Compiler.analyze(Compiler.java:5151) 9: clojure.lang.Compiler$SetExpr.parse(Compiler.java:2546) 10: clojure.lang.Compiler.analyze(Compiler.java:5196) 11: clojure.lang.Compiler.access$100(Compiler.java:35) 12: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:438) 13: clojure.lang.Compiler.analyzeSeq(Compiler.java:5369) 14: clojure.lang.Compiler.analyze(Compiler.java:5190) 15: clojure.lang.Compiler.analyze(Compiler.java:5151) 16: clojure.lang.Compiler.eval(Compiler.java:5428) 17: clojure.lang.Compiler.load(Compiler.java:5857) 18: clojure.lang.RT.loadResourceScript(RT.java:340) 19: clojure.lang.RT.loadResourceScript(RT.java:331) 20: clojure.lang.RT.load(RT.java:409) 21: clojure.lang.RT.load(RT.java:381) 22: clojure.core$load$fn__4511.invoke(core.clj:4905) 23: clojure.core$load.doInvoke(core.clj:4904) 24: clojure.lang.RestFn.invoke(RestFn.java:409) 25: clojure.core$load_one.invoke(core.clj:4729) 26: clojure.core$load_lib.doInvoke(core.clj:4766) 27: clojure.lang.RestFn.applyTo(RestFn.java:143) 28: clojure.core$apply.invoke(core.clj:542) 29: clojure.core$load_libs.doInvoke(core.clj:4800) 30: clojure.lang.RestFn.applyTo(RestFn.java:138) 31: clojure.core$apply.invoke(core.clj:542) 32: clojure.core$require.doInvoke(core.clj:4869) 33: clojure.lang.RestFn.invoke(RestFn.java:458) 34: swank.core.cdt_backends$eval2627$loading__4410__auto2628.invoke(cdt_backends.clj:1) 35: swank.core.cdt_backends$eval2627.invoke(cdt_backends.clj:1) 36: clojure.lang.Compiler.eval(Compiler.java:5424) 37: clojure.lang.Compiler.eval(Compiler.java:5415) 38: clojure.lang.Compiler.load(Compiler.java:5857) 39: clojure.lang.RT.loadResourceScript(RT.java:340) 40: clojure.lang.RT.loadResourceScript(RT.java:331) 41: clojure.lang.RT.load(RT.java:409) 42: clojure.lang.RT.load(RT.java:381) 43: clojure.core$load$fn__4511.invoke(core.clj:4905) 44: clojure.core$load.doInvoke(core.clj:4904) 45: clojure.lang.RestFn.invoke(RestFn.java:409) 46: clojure.core$load_one.invoke(core.clj:4729) 47: clojure.core$load_lib.doInvoke(core.clj:4766) 48: clojure.lang.RestFn.applyTo(RestFn.java:143) 49: clojure.core$apply.invoke(core.clj:542) --more-- I'm using cake which I believe does fancy things with classloaders - perhaps this is causing an issue here too? Where would be the best place to file a bug report? Sam ---http://sam.aaron.name -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
Hi George, On 25 Apr 2011, at 17:35, George Jahad wrote: Can you set breakpoints and catch exceptions per the test drive in the doc? Sort of. I'm not sure if I'm just doing the wrong things, but when execute (difference #{1 2} #{2 3}) after setting: (set-bp clojure.set/difference) I get a nice buffer popping up: CDT BreakpointEvent in thread Swank REPL Thread From here you can: e/eval, v/show source, s/step, x/next, o/exit func Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.set$difference.invoke(set.clj:48) 1: user$eval3070.invoke(NO_SOURCE_FILE:1) 2: clojure.lang.Compiler.eval(Compiler.java:5424) 3: clojure.lang.Compiler.eval(Compiler.java:5391) 4: clojure.core$eval.invoke(core.clj:2382) --more-- When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. for my reference, which os/version/ java version are you using? λ java -version java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) on OS X 10.6.7 Also, it sounds like cake setup if significantly different and I don't know anything about Cake. If you can generalize your setup and send it to me, I'll add it to the docs. I think the version I was describing before was over complicated for a basic 'getting started' doc. I was attempting to get swank-clojure/CDT set up so that it worked on all my projects without needing to explicitly add/change anything. This is clearly something to strive for *after* I've managed to get it working in the simplest case! Here's a simpler version of the setup: In a fresh new project (created with `cake new bar`) I edited the project.clj as follows: λ cat project.clj (defproject bar 0.0.1-SNAPSHOT :description TODO: add summary of your project :dependencies [[clojure 1.2.0]] :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT] [clojure-source 1.2.0]]) and created a file called config and placed it in .cake with the following contents: λ cat .cake/config jvm.opts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n I then pulled the deps with `cake deps`. My lib contains the following: λ tree lib lib ├── clojure-1.2.0.jar ├── deps.clj └── dev ├── cdt-1.2.6.1-20110417.030036-6.jar ├── clojure-source-1.2.0.jar ├── debug-repl-0.3.1.jar └── swank-clojure-1.4.0-20110417.030036-3.jar 1 directory, 6 files I can then start swank: λ cake swank Listening for transport dt_socket at address: 62404 started swank-clojure server on port 4005 please keep me posted about any other issues you find! Will do! Sam --- http://sam.aaron.name -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
It looks like you've got things pretty well figured out. If you're curious about the general case, #cake.clj on freenode may be of some help. On Apr 25, 2011, at 12:12 PM, Sam Aaron samaa...@gmail.com wrote: Hi George, On 25 Apr 2011, at 17:35, George Jahad wrote: Can you set breakpoints and catch exceptions per the test drive in the doc? Sort of. I'm not sure if I'm just doing the wrong things, but when execute (difference #{1 2} #{2 3}) after setting: (set-bp clojure.set/difference) I get a nice buffer popping up: CDT BreakpointEvent in thread Swank REPL Thread From here you can: e/eval, v/show source, s/step, x/next, o/exit func Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.set$difference.invoke(set.clj:48) 1: user$eval3070.invoke(NO_SOURCE_FILE:1) 2: clojure.lang.Compiler.eval(Compiler.java:5424) 3: clojure.lang.Compiler.eval(Compiler.java:5391) 4: clojure.core$eval.invoke(core.clj:2382) --more-- When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. for my reference, which os/version/ java version are you using? λ java -version java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) on OS X 10.6.7 Also, it sounds like cake setup if significantly different and I don't know anything about Cake. If you can generalize your setup and send it to me, I'll add it to the docs. I think the version I was describing before was over complicated for a basic 'getting started' doc. I was attempting to get swank-clojure/CDT set up so that it worked on all my projects without needing to explicitly add/change anything. This is clearly something to strive for *after* I've managed to get it working in the simplest case! Here's a simpler version of the setup: In a fresh new project (created with `cake new bar`) I edited the project.clj as follows: λ cat project.clj (defproject bar 0.0.1-SNAPSHOT :description TODO: add summary of your project :dependencies [[clojure 1.2.0]] :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT] [clojure-source 1.2.0]]) and created a file called config and placed it in .cake with the following contents: λ cat .cake/config jvm.opts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n I then pulled the deps with `cake deps`. My lib contains the following: λ tree lib lib ├── clojure-1.2.0.jar ├── deps.clj └── dev ├── cdt-1.2.6.1-20110417.030036-6.jar ├── clojure-source-1.2.0.jar ├── debug-repl-0.3.1.jar └── swank-clojure-1.4.0-20110417.030036-3.jar 1 directory, 6 files I can then start swank: λ cake swank Listening for transport dt_socket at address: 62404 started swank-clojure server on port 4005 please keep me posted about any other issues you find! Will do! Sam --- http://sam.aaron.name -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
On Apr 25, 7:26 am, Jeff Palmucci jpalmu...@gmail.com wrote: I get the same thing with just plain leiningen. It's not cake. I get this with Leiningen when using a JRE rather than a JDK. You need to be sure lib/tools.jar exists inside your Java home. -Phil -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. I doubt that. Most likely you have a fairly complicated installation, whose problems i haven't experienced yet. If anyone else has tried this, are you able to eval with the e key from the sldb buffer? Sam, can I suggest we eliminate those installation issues by experimenting with a known working project, e.g. logos and seeing if that works for you? If so, try this: git clone https://github.com/swannodette/logos.git use this project.clj: (defproject logos 0.6.1-SNAPSHOT :description Logic programming for Clojure :dependencies [[org.clojure/clojure 1.3.0-alpha5] [org.clojure.contrib/macro-utils 1.3.0-alpha4]] :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT] [clojure-source 1.3.0-alpha5] [lein-clojars 0.6.0]] :jvm-opts [-agentlib:jdwp=transport=dt_socket,server=y,suspend=n] ) Run lein deps and lein swank Then try setting a breakpoint. let me know. g -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
Hi Phil, On 25 Apr 2011, at 19:21, Phil Hagelberg wrote: On Apr 25, 7:26 am, Jeff Palmucci jpalmu...@gmail.com wrote: I get the same thing with just plain leiningen. It's not cake. I get this with Leiningen when using a JRE rather than a JDK. You need to be sure lib/tools.jar exists inside your Java home. This seems like a very answer indeed. Sorry if this sounds a bit dumb, but how do I run/use a JDK rather than a JRE. I'm just using a standard mac with developer tools installed (although I assume that has no Java elements these days). Might it already be installed and I'm not using it by default or is there a specific way of installing it? Running `locate tools.jar` doesn't seem to come up with any hits... Sam --- http://sam.aaron.name -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
On 25 Apr 2011, at 19:34, George Jahad wrote: When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. I doubt that. Most likely you have a fairly complicated installation, whose problems i haven't experienced yet. That's pretty unlikely unless it is specifically cake that's the issue. I was running in a completely new and empty project with nothing except clojure and swank-clojure as deps. Sam, can I suggest we eliminate those installation issues by experimenting with a known working project, e.g. logos and seeing if that works for you? This seems to work perfectly :-) No tools.jar errors and I can examine the contents of s1 and s2 - Great stuff! This is really exciting :-) However, if I create a fresh new logos clone, modify the project.clj again, and pull the deps with cake, add the .cake/config jvm.opts line and start a swank server I get the same issues I saw before: * A tools.jar warning * An exception when trying to eval s1 I think that this is pretty clearly a cake issue. I do think it would be cool if this worked out of the box with both lein and cake. I like lein, but cake has better native dependency support which I find extremely useful for my projects. Have any of the cake devs tried the CDT stuff yet? How might I help debug this? Sam --- http://sam.aaron.name -- 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: Clojure group in DFW area
I'd be interested as well. Thanks, Brett Bim On Apr 25, 11:29 am, Alex Robbins alexander.j.robb...@gmail.com wrote: That sounds good to me. On Mon, Apr 25, 2011 at 9:24 AM, ch...@rubedoinc.com ch...@rubedoinc.com wrote: I am interested as well and have office space in Addison near beltline and the tollway we can use. How about meeting next Monday may 2nd @ 630 pm? We can fo an organizational meeting about goals of the group, etc. On Mar 10, 8:28 am, Alex Robbins alexander.j.robb...@gmail.com wrote: Anyone else in the north Dallas area using/interested in Clojure? I'd love to get together. Alex -- 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
ANN: Slamhound (for reconstructing ns forms)
So I just threw together a little tool to help with ns forms. I find often they accumulate a bunch of cruft over time where you no longer need a given :use or :require form. And sometimes you don't feel like finding exactly where on the classpath a given class is. Or maybe you're too lazy to type it; whatever. Slamhound helps with that. (ns my.namespace some doc string) (defn -main [ args] (pprint args) (io/copy (ByteArrayInputStream. (.getBytes hello)) (first args))) Look at that; all bare, missing all kinds of necessary stuff. Disgraceful. Release the hound! $ lein slamhound src/my/namespace.clj (ns my.namespace I have a doc string. (:use [clojure.pprint :only [pprint]]) (:require [clojure.java.io :as io]) (:import (java.io ByteArrayInputStream))) Tada! (also featuring Emacs integration: M-x slamhound) Enjoy: https://github.com/technomancy/slamhound -Phil -- 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: Clojure group in DFW area
ch...@rubedoinc.com wrote: Rubedo, inc. 14580 Beltwood Pkwy E Suite 103 Farmers Branch, TX 75244 When: 630PM Monday May 2nd What: Clojure Interest Group Topic: 1st meeting, what our goals are, and how to take over the world with Clojure Hi Chris! Thanks for offering to host the group. I've added a link to this thread on the Clojure User Groups page: http://dev.clojure.org/display/community/Clojure+User+Groups. Hopefully to help people who might be looking. We can update the link to something with a little more information if you get a page set up somewhere. Also, if you choose to go through Meetup, they have provided us with a code that gives a discount to Clojure groups. See the above page for more information. Thanks again, and let me know if there's anything Clojure/core can help you out with! Thanks, Chris -- 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
Error with eval syntax-quote PersistentArrayMap
Hey all, I'm not quite understanding why an eval call is not working in this instance. A) works, but B) fails with an *java.lang.IllegalArgumentException *. A) Pretty straightforward ... user= `(+ 1 ~@[2 3]) (clojure.core/+ 1 2 3) … user= (eval `(+ 1 ~@[2 3])) 6 B) I just want to call my 'commands/add' function with a map and 'teal' (nil, in this case) user= `(commands/add ~processed ~@etal) (commands/add {:tag :user, :username stub, :content ({:tag :profileDetails, :content ({:tag :profileDetail, :name first.name, :value stub, :content nil} {:tag :profileDetail, :name last.name, :value stub, :content nil} {:tag :profileDetail , :name email, :value stub, :content nil} {:tag :profileDetail, :name country, :value stub, :content nil})})}) user= (eval `(commands/add ~processed)) *java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:89)* C) A stack trace isn't that helpful either user= (. *e printStackTrace) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:183) at clojure.lang.Compiler.eval(Compiler.java:5440) at clojure.lang.Compiler.eval(Compiler.java:5391) at clojure.core$eval.invoke(core.clj:2382) at bkell$add.doInvoke(bkell.clj:23) … What am I missing here? Thanks in advance Tim -- 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 with eval syntax-quote PersistentArrayMap
your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand. On Mon, Apr 25, 2011 at 7:29 PM, Timothy Washington twash...@gmail.com wrote: Hey all, I'm not quite understanding why an eval call is not working in this instance. A) works, but B) fails with an java.lang.IllegalArgumentException. A) Pretty straightforward ... user= `(+ 1 ~@[2 3]) (clojure.core/+ 1 2 3) … user= (eval `(+ 1 ~@[2 3])) 6 B) I just want to call my 'commands/add' function with a map and 'teal' (nil, in this case) user= `(commands/add ~processed ~@etal) (commands/add {:tag :user, :username stub, :content ({:tag :profileDetails, :content ({:tag :profileDetail, :name first.name, :value stub, :content nil} {:tag :profileDetail, :name last.name, :value stub, :content nil} {:tag :profileDetail , :name email, :value stub, :content nil} {:tag :profileDetail, :name country, :value stub, :content nil})})}) user= (eval `(commands/add ~processed)) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:89) C) A stack trace isn't that helpful either user= (. *e printStackTrace) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:183) at clojure.lang.Compiler.eval(Compiler.java:5440) at clojure.lang.Compiler.eval(Compiler.java:5391) at clojure.core$eval.invoke(core.clj:2382) at bkell$add.doInvoke(bkell.clj:23) … What am I missing here? Thanks in advance Tim -- 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 -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- 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 with eval syntax-quote PersistentArrayMap
Hey Kevin, thanks for getting back to me. The splice is 'etal' (which is null). I should have excluded it for clarity. What you're actually seeing is the map being unquoted: user= `(commands/add *~processed* ~@etal) (commands/add {:tag :user, :username stub ... }) ;; 'etal' does not show up in what gets evaluated - ** first in this list is a function Now, if I try to eval that, I get the said error. user= (eval `(commands/add *~processed*)) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) And I had tried macroexpand (here and in the containing function), and got the same error: user= (macroexpand (eval `(commands/add *~processed*))) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) You're right that the repl is using the map as a function. But I don't understand why when 'commands/add' function was the first thing in the return list. And macroexpand is yielding the same error . This is what had me so perplexed. Thanks again for the feedback. It's something small that I'm missing. Tim On Mon, Apr 25, 2011 at 10:40 PM, Kevin Downey redc...@gmail.com wrote: your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand. On Mon, Apr 25, 2011 at 7:29 PM, Timothy Washington twash...@gmail.com wrote: Hey all, -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
Hey guys- I spent some time trying to get this working today. My experiences mirror Sam's. I'm on a mac, running the jdk that ships with xcode4. According to http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html , tools.jar does not exist in the xcode jdk. George, are you perhaps using the openjdk? Once I get this straightened out, I'll confirm that cake's classloader hanky panky doesn't cause any other issues :) -lance On Apr 25, 12:12 pm, Sam Aaron samaa...@gmail.com wrote: On 25 Apr 2011, at 19:34, George Jahad wrote: When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. I doubt that. Most likely you have a fairly complicated installation, whose problems i haven't experienced yet. That's pretty unlikely unless it is specifically cake that's the issue. I was running in a completely new and empty project with nothing except clojure and swank-clojure as deps. Sam, can I suggest we eliminate those installation issues by experimenting with a known working project, e.g. logos and seeing if that works for you? This seems to work perfectly :-) No tools.jar errors and I can examine the contents of s1 and s2 - Great stuff! This is really exciting :-) However, if I create a fresh new logos clone, modify the project.clj again, and pull the deps with cake, add the .cake/config jvm.opts line and start a swank server I get the same issues I saw before: * A tools.jar warning * An exception when trying to eval s1 I think that this is pretty clearly a cake issue. I do think it would be cool if this worked out of the box with both lein and cake. I like lein, but cake has better native dependency support which I find extremely useful for my projects. Have any of the cake devs tried the CDT stuff yet? How might I help debug this? Sam ---http://sam.aaron.name -- 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 with eval syntax-quote PersistentArrayMap
sorry I cannot read your email On Mon, Apr 25, 2011 at 8:24 PM, Timothy Washington twash...@gmail.com wrote: Hey Kevin, thanks for getting back to me. The splice is 'etal' (which is null). I should have excluded it for clarity. What you're actually seeing is the map being unquoted: user= `(commands/add ~processed ~@etal) (commands/add {:tag :user, :username stub ... }) ;; 'etal' does not show up in what gets evaluated - ** first in this list is a function Now, if I try to eval that, I get the said error. user= (eval `(commands/add ~processed)) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) And I had tried macroexpand (here and in the containing function), and got the same error: user= (macroexpand (eval `(commands/add ~processed))) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) You're right that the repl is using the map as a function. But I don't understand why when 'commands/add' function was the first thing in the return list. And macroexpand is yielding the same error . This is what had me so perplexed. Thanks again for the feedback. It's something small that I'm missing. Tim On Mon, Apr 25, 2011 at 10:40 PM, Kevin Downey redc...@gmail.com wrote: your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand. On Mon, Apr 25, 2011 at 7:29 PM, Timothy Washington twash...@gmail.com wrote: Hey all, -- 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 -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- 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
Merging two maps based on ids
Can someone help me write a merge function between two maps? My problem is as follows: I have original data in a map: (def data-orig '({:id 2 :a2 34 :a3 76 :a4 87}, {:id 3 :a2 30 :a3 38 :a4 39}, {:id 5 :a2 67 :a3 32 :a4 38}, {:id 4 :a2 10 :a3 73 :a4 38}, {:id 7 :a2 84 :a3 86 :a4 63})) Then I have override data: (def data-override '({:id 2 :a2 5534 :a3 5576 :a4 5587}, {:id 3 :a2 5584 :a3 5586 :a4 5563}, {:id 12 :a2 5593 :a3 5512 :a4 5539}, {:id 13 :a2 5509 :a3 5539 :a4 5592})) The result should be a merge of the two with the following conditions: If the id is the same, should override the original data. If id is not present in original then it should be added. The result should be: '({:id 2 :a2 5534 :a3 5576 :a4 5587}, ;overriden {:id 3 :a2 5584 :a3 5586 :a4 5563}, ;overriden {:id 5 :a2 67 :a3 32 :a4 38}, {:id 4 :a2 10 :a3 73 :a4 38}, {:id 7 :a2 84 :a3 86 :a4 63}, {:id 12 :a2 5593 :a3 5512 :a4 5539}, ;added {:id 13 :a2 5509 :a3 5539 :a4 5592}) ;added Thanks for your help. -- Shoeb -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
not using openjdk. and the tools.jar issue is probably a red herring. i'll try installing cake and see if i can notice anything. definitely want to keep cake users happy! On Apr 25, 8:33 pm, lance bradley lancebrad...@gmail.com wrote: Hey guys- I spent some time trying to get this working today. My experiences mirror Sam's. I'm on a mac, running the jdk that ships with xcode4. According tohttp://developer.apple.com/library/mac/#documentation/Java/Conceptual... , tools.jar does not exist in the xcode jdk. George, are you perhaps using the openjdk? Once I get this straightened out, I'll confirm that cake's classloader hanky panky doesn't cause any other issues :) -lance On Apr 25, 12:12 pm, Sam Aaron samaa...@gmail.com wrote: On 25 Apr 2011, at 19:34, George Jahad wrote: When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. I doubt that. Most likely you have a fairly complicated installation, whose problems i haven't experienced yet. That's pretty unlikely unless it is specifically cake that's the issue. I was running in a completely new and empty project with nothing except clojure and swank-clojure as deps. Sam, can I suggest we eliminate those installation issues by experimenting with a known working project, e.g. logos and seeing if that works for you? This seems to work perfectly :-) No tools.jar errors and I can examine the contents of s1 and s2 - Great stuff! This is really exciting :-) However, if I create a fresh new logos clone, modify the project.clj again, and pull the deps with cake, add the .cake/config jvm.opts line and start a swank server I get the same issues I saw before: * A tools.jar warning * An exception when trying to eval s1 I think that this is pretty clearly a cake issue. I do think it would be cool if this worked out of the box with both lein and cake. I like lein, but cake has better native dependency support which I find extremely useful for my projects. Have any of the cake devs tried the CDT stuff yet? How might I help debug this? Sam ---http://sam.aaron.name -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
I'll keep at it too. Make sure you do a manual checkout and use the develop branch. I suspected this would be the fix, but I was wrong- it could still be necessary though: https://github.com/ninjudd/cake/commit/8d70cb88fd83e6aec17a0dac05e97f5473380e92 On Apr 25, 9:30 pm, George Jahad cloj...@blackbirdsystems.net wrote: not using openjdk. and the tools.jar issue is probably a red herring. i'll try installing cake and see if i can notice anything. definitely want to keep cake users happy! On Apr 25, 8:33 pm, lance bradley lancebrad...@gmail.com wrote: Hey guys- I spent some time trying to get this working today. My experiences mirror Sam's. I'm on a mac, running the jdk that ships with xcode4. According tohttp://developer.apple.com/library/mac/#documentation/Java/Conceptual... , tools.jar does not exist in the xcode jdk. George, are you perhaps using the openjdk? Once I get this straightened out, I'll confirm that cake's classloader hanky panky doesn't cause any other issues :) -lance On Apr 25, 12:12 pm, Sam Aaron samaa...@gmail.com wrote: On 25 Apr 2011, at 19:34, George Jahad wrote: When I press e the mini buffer prompts me to Eval in frame: and I propmpty type s1 to see the following error in the minibuffer: Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method This stuff is all new to me, so I'm likely to be doing something silly. I doubt that. Most likely you have a fairly complicated installation, whose problems i haven't experienced yet. That's pretty unlikely unless it is specifically cake that's the issue. I was running in a completely new and empty project with nothing except clojure and swank-clojure as deps. Sam, can I suggest we eliminate those installation issues by experimenting with a known working project, e.g. logos and seeing if that works for you? This seems to work perfectly :-) No tools.jar errors and I can examine the contents of s1 and s2 - Great stuff! This is really exciting :-) However, if I create a fresh new logos clone, modify the project.clj again, and pull the deps with cake, add the .cake/config jvm.opts line and start a swank server I get the same issues I saw before: * A tools.jar warning * An exception when trying to eval s1 I think that this is pretty clearly a cake issue. I do think it would be cool if this worked out of the box with both lein and cake. I like lein, but cake has better native dependency support which I find extremely useful for my projects. Have any of the cake devs tried the CDT stuff yet? How might I help debug this? Sam ---http://sam.aaron.name -- 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 with eval syntax-quote PersistentArrayMap
Oh sorry, were the colors off? Let's try this. The map was actually unquoted. 'etal' (which was null) was unquote-spliced. I excluded it for clarity: * user= `(commands/add ~processed) * * result= (my-function my-map) ;; ** first in this list is a function * Now, if I try to eval that, I get the said error. * user= (eval `(commands/add ~processed))* * result= java.lang.IllegalArgumentException: ...* And I had tried macroexpand (here and in the containing function), and got the same error: * user= (macroexpand (eval `(commands/add ~processed)))* * result= java.lang.IllegalArgumentException: ...* You're right that the repl is using the map as a function. But I don't understand why when 'commands/add' function was the first thing in the return list. And macroexpand is yielding the same error . This is what had me so perplexed. Hopefully this reads a bit better. Thanks Tim On Tue, Apr 26, 2011 at 12:00 AM, Kevin Downey redc...@gmail.com wrote: sorry I cannot read your email On Mon, Apr 25, 2011 at 8:24 PM, Timothy Washington twash...@gmail.com wrote: Hey Kevin, thanks for getting back to me. The splice is 'etal' (which is null). I should have excluded it for clarity. What you're actually seeing is the map being unquoted: user= `(commands/add ~processed ~@etal) (commands/add {:tag :user, :username stub ... }) ;; 'etal' does not show up in what gets evaluated - ** first in this list is a function Now, if I try to eval that, I get the said error. user= (eval `(commands/add ~processed)) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) And I had tried macroexpand (here and in the containing function), and got the same error: user= (macroexpand (eval `(commands/add ~processed))) java.lang.IllegalArgumentException: Wrong number of args (3) passed to: PersistentArrayMap (NO_SOURCE_FILE:324) You're right that the repl is using the map as a function. But I don't understand why when 'commands/add' function was the first thing in the return list. And macroexpand is yielding the same error . This is what had me so perplexed. Thanks again for the feedback. It's something small that I'm missing. Tim On Mon, Apr 25, 2011 at 10:40 PM, Kevin Downey redc...@gmail.com wrote: your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand. On Mon, Apr 25, 2011 at 7:29 PM, Timothy Washington twash...@gmail.com wrote: Hey all, -- 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 -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- 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: Merging two maps based on ids
Can someone help me write a merge function between two maps? My problem is as follows: I have original data in a map: (def data-orig '({:id 2 :a2 34 :a3 76 :a4 87}, {:id 3 :a2 30 :a3 38 :a4 39}, {:id 5 :a2 67 :a3 32 :a4 38}, {:id 4 :a2 10 :a3 73 :a4 38}, {:id 7 :a2 84 :a3 86 :a4 63})) Then I have override data: (def data-override '({:id 2 :a2 5534 :a3 5576 :a4 5587}, {:id 3 :a2 5584 :a3 5586 :a4 5563}, {:id 12 :a2 5593 :a3 5512 :a4 5539}, {:id 13 :a2 5509 :a3 5539 :a4 5592})) The result should be a merge of the two with the following conditions: If the id is the same, should override the original data. If id is not present in original then it should be added. The result should be: In the trivial case, you can use clojure.core/merge. Merge takes a variable number of maps and merges them together. If there is a conflict with keys, it will give preference to the latter map in left to right order. But in your case, you can write a trivial function that removes the common maps from data-orig first and then does a merge - (defn merge-override [merge-key override orig] (let [keyset (into #{} (map #(% merge-key) override))] (apply merge override (remove #(keyset (% merge-key)) orig (merge-override :id data-override data-orig) ; = ({:id 7, :a2 84, :a3 86, :a4 63} {:id 4, :a2 10, :a3 73, :a4 38} {:id 5, :a2 67, :a3 32, :a4 38} {:id 2, :a2 5534, :a3 5576, :a4 5587} {:id 3, :a2 5584, :a3 5586, :a4 5563} {:id 12, :a2 5593, :a3 5512, :a4 5539} {:id 13, :a2 5509, :a3 5539, :a4 5592}) ;; pprint - ;; ({:id 7, :a2 84, :a3 86, :a4 63} ;; {:id 4, :a2 10, :a3 73, :a4 38} ;; {:id 5, :a2 67, :a3 32, :a4 38} ;; {:id 2, :a2 5534, :a3 5576, :a4 5587} ;; {:id 3, :a2 5584, :a3 5586, :a4 5563} ;; {:id 12, :a2 5593, :a3 5512, :a4 5539} ;; {:id 13, :a2 5509, :a3 5539, :a4 5592}) Hope that helps. Regards, BG -- 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: swank-cdt: Using Slime with the Clojure Debugging Toolkit
On Apr 25, 12:12 pm, Sam Aaron samaa...@gmail.com wrote: I like lein, but cake has better native dependency support which I find extremely useful for my projects. I'm curious, what are your requirements for native dependencies? I have never needed them, so I've relied on contributors and external plugins because I don't know what's needed. But if it's a blocker for some it could get merged into Leiningen itself. I've looked at the plugin and it seems pretty simple. What's missing? -Phil -- 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