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

2015-08-25 Thread dmichulke
If you have assertions enabled, you can declare (defn foo [a b & {:keys [c d]}] {:pre [c d]} 1) to make sure that c and d are not nil (defn foo [a b & {:keys [c d] :as m}] {:pre [(every? m [:c :d]]} 1) to make sure that c and d are contained and (defn foo [a b & {:keys [c d] :as m}] {:pre

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

2015-08-25 Thread dmichulke
Oh and (zero (count x)) is probably less idiomatic than (empty? x) -- 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 yo

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

2015-08-25 Thread dmichulke
Sorry, I answered too quickly: The second one was wrong - this one ensures c and d are contained. (defn foo [a b & {:keys [c d] :as m}] {:pre [(every? (partial contains? m) [:c :d]]} 1) And the last one was un-idiomatic - this one checks whether only c and d are contained. (defn foo [a b & {:

Re: I am looking for xml parsing lib

2015-08-25 Thread Josh Kamau
Thanks all. clojure.xml/parse worked for me. On Tue, Aug 25, 2015 at 1:52 AM, Jordan Schatz wrote: > Which is the recommended xml parsing lib for clojure? > > > I think you are after clojure.xml/parse > http://conj.io/store/v1/org.clojure/clojure/1.7.0/clj/clojure.xml/parse/ > and friends: > htt

map over a Map with conditional conj

2015-08-25 Thread Sven Richter
Hi, I find myself repeating a certain pattern from time to time. I have a map like this: {:answer_correct_1 2 :answer_correct_3 4 :foo "bar"} There is a hidden index answer_correct_idx which might range from 1 to x. So, what I want is to "iterate" over the map and produce a vec of maps given s

Re: [ANN] Grenada 1.0.0-rc.2

2015-08-25 Thread zcaudate
Hey Richard, Great work on the project! I'd love to see the final generated output if you have time to do so. Also, we at Helpshift are working on a similar project here - https://github.com/helpshift/hydrox. It'll be great to get your input to see how the two libraries compare, what each one p

Re: map over a Map with conditional conj

2015-08-25 Thread Moe Aboulkheir
Sven, To me, the keep version would be a lot more readable if it were creating a literal map in a fn. I think (for) is almost always the right thing. It's not as fun to write, but much easier to read: (for [i (range 1 11) :let [id (keyword (str "answer_correct_" i))] :when (params i

Re: map over a Map with conditional conj

2015-08-25 Thread Sven Richter
Hi Moe, Thanks, i didn't know about :when and :let in for. That is my favorite so far, small and readable, looks good. Sven Am Dienstag, 25. August 2015 11:17:23 UTC+2 schrieb Moe Aboulkheir: > > Sven, > > To me, the keep version would be a lot more readable if it were creating a > literal map

top-level lets or private globals

2015-08-25 Thread Kurt Sys
I'm refering to a few posts in an old thread: https://groups.google.com/d/msg/clojure/r_ym-h53f1E/RzUdb5oYeX4J What really puzzles me is that it doesn't seem to be generally > regarded as idiomatic Clojure style to just use top-level (let)s for > your "private" globals. So, here's the questio

Clojure 1.6 NoClassDefFoundError and a story

2015-08-25 Thread Emin Kura
Hi, I'm relatively new to Clojure, maybe this is well known problem please excuse me for this. First, let me give some context and then ask the question; (maybe it's interesting story for somebody out there ) I was developing remote logger server in Clojure recently. Core.async, generally Cloj

Re: Cursive and gen-class

2015-08-25 Thread Alex Miller
Fluid, I agree with Daniel that calling something "junk" is unnecessary, especially when the people making and using such a tool are on the list. We would like this to be a thoughtful, encouraging forum for discussion. Alex -- You received this message because you are subscribed to the Google

ANN: s3-wagon-private 1.2.0

2015-08-25 Thread Daniel Compton
Hi folks s3-wagon-private is a Leiningen plugin which lets you use a private S3 bucket as a Maven repo, typically for internal artifacts that you don't want to publish to Clojars. If you are spending any time at all lein installing your coworkers p

Scripting with Clojure(Script) : plain Clojure ? Node.js ? Boot ? Planck ? Pixie ?

2015-08-25 Thread Khalid Jebbari
Hi every one, Just starting this thread to gather feedback from people who used CLJ(S) to script and replace, you know, shell/Python/Ruby/Whatever. Pretty sure it's a dream to code AND script with CLJ(S). I know that it's possible to do it with CLJS backed by Node.js/io.js, with Boot somehow, w

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Brian
A bit late to the party but please include me in the list of possible reviews. thanks, BDF. On Tue, Aug 25, 2015 at 12:06 AM, Akhil Wali wrote: > Thank you everyone for the great response! > I'll notify Packt and they shall contact anyone who is shortlisted as a > reviwer. > > > On Monday, Augu

Re: [ANN] io.aviso/rook 0.1.36

2015-08-25 Thread Atamert Ölçgen
Hi Howard, In the example application it seems the routing information is encoded in the beginning of the docstring and not the actual metadata. Is there an option to put this info in the metadata of the var? On Mon, Aug 24, 2015 at 6:31 PM, Howard Lewis Ship wrote: > Rook is a set of middlewar

Re: Cursive and gen-class

2015-08-25 Thread Fluid Dynamics
On Tuesday, August 25, 2015 at 8:25:12 AM UTC-4, Alex Miller wrote: > > Fluid, I agree with Daniel that calling something "junk" is unnecessary, > especially when the people making and using such a tool are on the list. We > would like this to be a thoughtful, encouraging forum for discussion. >

Re: Cursive and gen-class

2015-08-25 Thread Colin Fleming
On 25 August 2015 at 18:22, Fluid Dynamics wrote: > I seem to recall criticizing a piece of Clojure-relevant *technology* that > had the rather remarkable property that it could be working, be deleted and > reinstalled (exact same version), and suddenly be *not* working. > Except that's not actu

How to move an element within a vector?

2015-08-25 Thread Hussein B.
Hi, For a vector like [A B C D E], how to remove an element to a specific location? For example [A D B C E] ? I thought about converting the vector into array but I would feel bad if I did that. What would be the idiomatic way to do that in Clojure? Thanks for help and time. -- You received

Re: Cursive and gen-class

2015-08-25 Thread Alex Miller
On Tuesday, August 25, 2015 at 11:23:00 AM UTC-5, Fluid Dynamics wrote: > > On Tuesday, August 25, 2015 at 8:25:12 AM UTC-4, Alex Miller wrote: >> >> Fluid, I agree with Daniel that calling something "junk" is unnecessary, >> especially when the people making and using such a tool are on the list

Re: Cursive and gen-class

2015-08-25 Thread Colin Yates
+1, let's keep the Clojure community respectful and welcoming. This has been distracting enough already. On 25 Aug 2015 18:12, "Alex Miller" wrote: > > On Tuesday, August 25, 2015 at 11:23:00 AM UTC-5, Fluid Dynamics wrote: >> >> On Tuesday, August 25, 2015 at 8:25:12 AM UTC-4, Alex Miller wrote

Re: I am looking for xml parsing lib

2015-08-25 Thread Atamert Ölçgen
Just a general note: if a library is not updated for X months/years, it doesn't necessarily mean it's obsolete/totally useless. I sometimes do this myself too, but I've recently found a library that hasn't been updated for a looong time and it works perfectly fine. On Tue, Aug 25, 2015 at 11:31 AM

Re: How to move an element within a vector?

2015-08-25 Thread Fluid Dynamics
On Tuesday, August 25, 2015 at 1:06:30 PM UTC-4, Hussein B. wrote: > > Hi, > > For a vector like [A B C D E], how to remove an element to a specific > location? For example [A D B C E] ? > How about (assoc (assoc v j (v i)) i (v j)), once you have the indices i and j of two elements you wish to

Re: Cursive and gen-class

2015-08-25 Thread Fluid Dynamics
On Tuesday, August 25, 2015 at 1:05:30 PM UTC-4, Colin Fleming wrote: > > On 25 August 2015 at 18:22, Fluid Dynamics > wrote: > >> I seem to recall criticizing a piece of Clojure-relevant *technology* >> that had the rather remarkable property that it could be working, be >> deleted and reinstal

Re: Cursive and gen-class

2015-08-25 Thread Niels van Klaveren
If you had read more attentively, he uninstalled Cursive because he suspected a reinstall might fix an error. However, the error was caused because in Cursive, an extra step is necessary configuring the project to make gen-class work in certain situations, so the unistall was unnecessary. When

Re: Cursive and gen-class

2015-08-25 Thread William la Forge
Actually what happened is that the cursive plugin continued working even after I upgraded to idea 14.1. Though obviously I could not reinstall the same plugin subsequent to that upgrade after an uninstall. At least, I am pretty sure that that is what happened. :-) Can we close this thread please?

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Bryant
I'd be interested in reviewing this book as well. Thanks! On Monday, August 24, 2015 at 1:46:06 AM UTC-5, Akhil Wali wrote: > > If anyone is interested in being a reviewer for a new book "*Mastering > Clojure*" by Packt Publishing, please let me know. > Reviewers will be entitled to a 6 montn sub

Re: Cursive and gen-class

2015-08-25 Thread Alan Moore
I'll second that motion. A minor point of clarification re my previous comment: the issues with Eclipse have nothing to do with CCW as it wasn't even installed. My comment was more broadly aimed, lest anyone mistakenly think I was slighting CCW in any way. Moving on... Alan On Tuesday, Augu

Re: [Meta] Anyone else having trouble with this site recently?

2015-08-25 Thread Chad Harrington
The site is working fine for me. In case it's helpful, I have had trouble loading Google sites in the past when I have inadvertently left my iPhone's personal hotspot turned on while my computer is connected to both my phone and my home network. The multiple routes seem to confuse Google's ability

Re: top-level lets or private globals

2015-08-25 Thread Alan Thompson
Ya know, I've never seen that before but I like it! I have noticed that you can have "naked" expressions in a file (i.e. not inside of a def/defn). For example, I use a statement like this: (require '[tupelo.core :refer [spyx]]) (spyx *clojure-version*) at the top of my main testing namespace t

Re: top-level lets or private globals

2015-08-25 Thread Alan Thompson
*** premature send *** Ya know, I've never seen that before but I like it! I have previously noticed (by accident) that you can have "naked" expressions in a file/namespace (i.e. not inside of a def/defn). For example, I use a statement like this: (ns ... (:require [tupelo.core :refer [spyx]]

[ANN] - New Clojure Instant Answer on DuckDuckGo

2015-08-25 Thread Rafik NACCACHE
Hi Guys, I contributed an Instant Answer to DuckDuckGo. When you search for "Clojure" with a number of terms, you directly have under the "software" tab all the packages matching your query from Clojars. Enjoy ! Rafik -- You received this message because you are subscribed to the Google Grou

Re: [ANN] - New Clojure Instant Answer on DuckDuckGo

2015-08-25 Thread Nicolas Herry
> On 26 Aug 2015, at 00:04, Rafik NACCACHE wrote: > > Hi Guys, > > I contributed an Instant Answer to DuckDuckGo. > > > When you search for "Clojure" with a number of terms, you directly have under > the "software" tab all the packages matching your query from Clojars. Nice ! Very handy, th

Re: [ANN] - New Clojure Instant Answer on DuckDuckGo

2015-08-25 Thread James Reeves
Nice work :) - James On 25 August 2015 at 23:04, Rafik NACCACHE wrote: > Hi Guys, > > I contributed an Instant Answer to DuckDuckGo. > > > When you search for "Clojure" with a number of terms, you directly have > under the "software" tab all the packages matching your query from Clojars. > > En

Re: [ANN] - New Clojure Instant Answer on DuckDuckGo

2015-08-25 Thread Reid McKenzie
Nice! Reid On 08/25/2015 05:04 PM, Rafik NACCACHE wrote: > Hi Guys, > > I contributed an Instant Answer to DuckDuckGo. > > > When you search for "Clojure" with a number of terms, you directly > have under the "software" tab all the packages matching your query > from Clojars. > > Enjoy ! > > Rafi

Re: How to move an element within a vector?

2015-08-25 Thread Georgi Danov
How about filtering? BTW I don't see how it would help converting to array - what would be the solution then? On Tuesday, August 25, 2015 at 7:06:30 PM UTC+2, Hussein B. wrote: > > Hi, > > For a vector like [A B C D E], how to remove an element to a specific > location? For example [A D B C E]

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Nicolas Modrzyk
Hi, I have reviewed other IT books before and also using clojure on an everyday basis. I would really love to be able to review this new Clojure book. Nico On Monday, August 24, 2015 at 3:46:06 PM UTC+9, Akhil Wali wrote: > > If anyone is interested in being a reviewer for a new book "*Master

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

2015-08-25 Thread Brian Marick
Dave Tenny wrote: Specter looks nice. I didn't see any examples in the readme or tests for working with more deeply nested data structures such as those discussed in this thread, any pointers? Here's an example that might be relevant to the original question. Suppose you have this structure

Re: [ANN] Grenada 1.0.0-rc.2

2015-08-25 Thread Richard Möhn
Am Dienstag, 25. August 2015 18:11:25 UTC+9 schrieb zcaudate: > > […] > Great work on the project! I'd love to see the final generated output if > you have time to do so. Also, we at Helpshift are working on a similar > project here - https://github.com/helpshift/hydrox. It'll be great to get >

[ANN] ike.cljj 0.2.2

2015-08-25 Thread Andrew Oberstar
After some lein mishaps, 0.2.2 (which is really 0.2.0) is now available through Clojars. ike.cljj is meant to support better interop with Java 7/8 APIs (such as Stream and Function). The sole addition in 0.2.2 is the ike.cljj.file namespace which provides wrappers for java.nio.file APIs. https://

Re: [ANN] Grenada 1.0.0-rc.2

2015-08-25 Thread Chris Zheng
Hey Richard, Yep, it’s exactly how you’ve described. The main emphasis is on writing documentation that can be verified through tests and so if the api changes, then the documentation can be fixed accordingly. The grenada project looks to be very ambitious in it’s scope and yeah, it’ll be amaz

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Akhil Wali
It's great to see so many volunteers for this project! Like I mentioned earlier, I have notified Packt and they shall contact anyone who is shortlisted as a reviewer. On Monday, August 24, 2015 at 12:16:06 PM UTC+5:30, Akhil Wali wrote: > > If anyone is interested in being a reviewer for a new bo

Re: [ANN] Grenada 1.0.0-rc.2

2015-08-25 Thread Richard Möhn
Am Mittwoch, 26. August 2015 14:52:31 UTC+9 schrieb zcaudate: > > […] > Yep, it’s exactly how you’ve described. The main emphasis is on writing > documentation that can be verified through tests and so if the api changes, > then the documentation can be fixed accordingly. > > The grenada projec

Re: top-level lets or private globals

2015-08-25 Thread Kurt Sys
Well, honestly, I tend to use pretty big lets in my namespaces. I know I can use (private) namespace-scoped variables (or rather, contstants :) ) , but somehow, I don't really like them. So what I mostly have now: (ns my.namespece (require [other.namespace : as o] [cool.namespace

Re: top-level lets or private globals

2015-08-25 Thread Kurt Sys
**EDIT: I've put some (private, mostly pretty small) 'helper'-functions outside the let-block. I like this kind of construct in some way. It makes a clear distinction between: 1. functions that don't use the 'namespace constants', mostly helper functions (very often, most of these can be