Re: :keys and :or destructuring where defaults refer to one another

2014-12-12 Thread Michał Marczyk
I created a ticket and posted a patch: http://dev.clojure.org/jira/browse/CLJ-1613 On 12 December 2014 at 08:35, Michał Marczyk michal.marc...@gmail.com wrote: (let [foo 1 bar 2 {:keys [bar foo] :or {foo 3 bar (inc foo)}} {}] {:foo foo :bar bar}) ;= {:foo 3, :bar

Re: Charting Data Format Feedback Requested

2014-12-12 Thread Mike Anderson
Lucas, Thanks for kicking off the discussion - great to see your proposal on this. I think it will be really valuable if we can converge on a standard way of representing this kind of data in Clojure/ClojureScript. Copying the Incanter and main Clojure groups as well because I think there will

Can I use reduce here?

2014-12-12 Thread Mathias Picker
Hi all, a short question from a newbie. I have a data structure like: mytitle1; 2015-02-01 mytitle2; 2015-03-12 ;2015-03-28 mytitle3; 2015-01-12 and want something like this [{:title mytitle1 :events [{:date 2015-02-01}]} {:title mytitle2 :events [{:date 2015-03-12} {:date 2015-03-28}]}

Re: Can I use reduce here?

2014-12-12 Thread Robin Heggelund Hansen
(def sample [mytitle1 2015-02-01 mytitle 2015-03-12 2015-03-28 mytitle3 2015-01-12]) ;; Turns the map above into a map, skip this if you already have a map (def working-set (- sample (partition 2) ;; Gives you

Re: Can I use reduce here?

2014-12-12 Thread Robin Heggelund Hansen
If you want to turn the CSV text into a string, you can either find CSV decoders, or take a look at split-with kl. 11:07:58 UTC+1 fredag 12. desember 2014 skrev Mathias Picker følgende: Hi all, a short question from a newbie. I have a data structure like: mytitle1; 2015-02-01 mytitle2;

Re: Can I use reduce here?

2014-12-12 Thread Mathias Picker
Hi Robin, thanks for the example of reduce above! That was what I was looking for. I will try it out once I'm at my desk again. / Mathias -- 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

Re: Can I use reduce here?

2014-12-12 Thread Robin Heggelund Hansen
Wow, I made a lot of mistakes. It should of course reduce into [] (not {}) and then it should be conj instead of assoc. I also made several spelling mistakes... Should probably sleep more I guess :P kl. 11:57:00 UTC+1 fredag 12. desember 2014 skrev Mathias Picker følgende: Hi Robin,

Re: [ANN] BigBang v0.1.1 - compose stuartsierra.component/system-update(s) in start invocation time

2014-12-12 Thread JUAN ANTONIO Ruz
Hi James! You're right I wrote a lot about the relation between component definition, update-system fn and system customization but very little about BigBang... Basically with the minimal code provided https://github.com/milesian/BigBang/blob/master/src/milesian/bigbang.clj (only 11LOC) I

Re: [ANN] BigBang v0.1.1 - compose stuartsierra.component/system-update(s) in start invocation time

2014-12-12 Thread JUAN ANTONIO Ruz
and about ...something that's hard to do with just Component, and easy to do with BigBang in my last example https://github.com/milesian/bigbang-example/blob/master/src/bigbang_example/core.clj#L60-L64 I could use 3 different library update-system actions in a specific start sequence

Re: Charting Data Format Feedback Requested

2014-12-12 Thread Matt Revelle
I had started thinking about this problem recently too and also had broken it down to two parts. I was going to create a simple data frame protocol for a) and a ggplot2-inspired library which emits SVG for b). There is prior work for plotting in Incanter (using JFreeChart) and David Liebke

ANN: core.match 0.3.0-alpha1, enhancements breaking changes

2014-12-12 Thread David Nolen
core.match, an efficient pattern matcher for Clojure ClojureScript New release version: 0.3.0-alpha1 ## Dependency information Maven pom.xml dependency groupIdorg.clojuer/groupId artifactIdcore.match/artifactId version0.3.0-alpha1/version /dependency Leiningen

Re: ANN: core.match 0.3.0-alpha1, enhancements breaking changes

2014-12-12 Thread David Nolen
Erg, Lein dep information should be the following of course: Leiningen project.clj [org.clojure/core.match 0.3.0-alpha1] On Fri, Dec 12, 2014 at 12:54 PM, David Nolen dnolen.li...@gmail.com wrote: core.match, an efficient pattern matcher for Clojure ClojureScript New release version:

Re: ANN: core.match 0.3.0-alpha1, enhancements breaking changes

2014-12-12 Thread Reid McKenzie
Looks awesome. Thanks David! Reid On 12/12/14 12:01, David Nolen wrote: Erg, Lein dep information should be the following of course: Leiningen project.clj [org.clojure/core.match 0.3.0-alpha1] On Fri, Dec 12, 2014 at 12:54 PM, David Nolen dnolen.li...@gmail.com wrote: core.match, an

Class Loader Issue - Using Clojure for Annotation Processing

2014-12-12 Thread Frankie Sardo
Hi all, I'd like to use Clojure for processing Java annotations at compile time. (Particularly useful for Android) https://github.com/frankiesardo/icepick/blob/clojure/src/icepick/core.clj I'm extending javax.annotation.processing.AbstractProcessor, I can create the generated class, I can test

Re: ANN: core.match 0.3.0-alpha1, enhancements breaking changes

2014-12-12 Thread David Nolen
Just cut 0.3.0-alpha2, the only change is a fix for when fn application patterns are nested in map/vector patterns. David On Fri, Dec 12, 2014 at 12:54 PM, David Nolen dnolen.li...@gmail.com wrote: core.match, an efficient pattern matcher for Clojure ClojureScript New release version:

[ANN] bote 0.1.0 - smtp server as a library

2014-12-12 Thread Christian Weilbach
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, https://github.com/ghubber/bote I have wrapped subethasmtp to allow to run a smtp server easily and just catch e-mails as values as they are just messages instead of the horrible configuration nightmares unix mail servers build around mail

Re: Can I use reduce here?

2014-12-12 Thread Jarrod Swart
Mathias, I wrote a short article about building more complex reduce functions here[1]. I wrote it mostly to reinforce my own knowledge. The bottom section will be most relevant to you. Hope it helps, Jarrod [1]: http://jarrodswart.com/articles/clojure-tutorial-reduce-functions On Friday,

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
HI David, - you're grouping your side-effecting code w/the code that generates the diamond data structure here: https://gist.github.com/ddellacosta/ba7e03951ba1bafd3ec9 While of course the diamond kata is a bit contrived and the point is to print stuff out in the end, it also looks like

core.typed questions

2014-12-12 Thread Jesse
Hi guys, Does anyone know how to properly deal with refs in core.typed? I am running into trouble. When I try to do stuff like this: (ann my-ref (Ref1 (U Kw nil))) (def my-ref (ref #{})) I get this error: IllegalArgumentException No value supplied for key: true

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
Hi David, a style like I used in my solution which aims for readable conciseness When I first looked at your code, just quickly scanning it, I felt that it was nice and concise, but I find parameter names like 'len' and 'idx' terse rather than concise. In Venkat Subramaniam's words (in

Re: core.typed questions

2014-12-12 Thread Di Xu
2014-12-13 13:41 GMT+08:00 Jesse jesseluisd...@gmail.com: Hi guys, Does anyone know how to properly deal with refs in core.typed? I am running into trouble. When I try to do stuff like this: (ann my-ref (Ref1 (U Kw nil))) (def my-ref (ref #{})) I get this error:

Re: core.typed questions

2014-12-12 Thread Jesse
Thanks Di Xu. Good to know. I have joined the core.typed group and will post my questions there from now on. J On Friday, December 12, 2014 11:41:43 PM UTC-6, Jesse wrote: Hi guys, Does anyone know how to properly deal with refs in core.typed? I am running into trouble. When I try to do

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
Hi Dave, I think you would find it more natural to work line by line vs. the way you constructed blocks and flipped them right/left, and you'd have less code overall. the problem I set myself was not to find a/the natural way to work, or to write as little code as possible, but to

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
Hi David, - Stylistically, I found your naming conventions to be too verbose Do you mean you find the method and variable names too long? Here was my first attempt at the diamond kata in Clojure (written in 40 minutes during a commute) (defn print-diamond [letter] (let [alphabet

Re: what do you think about this code?

2014-12-12 Thread David Della Costa
Philip, one clarification--re: function with side-effects, I meant to link here, which I followed up with in a later post, but I think it got lost in the shuffle:

Re: what do you think about this code?

2014-12-12 Thread David Della Costa
I think reasonable people can disagree on the details here--I think the names I chose were good enough and would be understood by Clojure programmers familiar with the standard data structures and core functions. I should point out that some of these names are conventional in Clojure land, for