Re: [ANN] stories - bdd lib for clojure

2013-05-03 Thread Steven Degutis
The repo has moved. There are two locations (so far): https://github.com/otfrom/stories https://github.com/meteorfox/stories On Thu, May 2, 2013 at 5:50 PM, Steven Degutis sbdegu...@gmail.com wrote: Here, it's back up for a while: https://github.com/sdegutis/stories Please fork it. -Steven

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
On 02/05/13 22:21, Steven Degutis wrote: Given pseudo-code (Ruby-ish): due = 100 cards = cards.map do |card| card.applied_balance = max(0, due - card.balance) due -= card.applied_balance Notice how due changes at each turn, and each successive item in cards sees the change. What's

[GSoC] Update: student proposal deadline; mentors, please sign up

2013-05-03 Thread Daniel Solano Gómez
Hello, all, Here's a quick update on what's going on with Clojure's participation in this year's Google Summer of Code. We have already received a number of strong proposals, and I can only hope we will be able to accept them all. What's going on? The student application

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
something like this perhaps? (loop [[c more]] cards res [] due 100] (if-not c res (recur more (conj res (doto c (.setAppliedBalance (max 0 (- due ) (- due (.getBalance c ) Jim ps: haven't got a clue what objects you're working with so I'm

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
oops there is a typo! line 6 should be: (conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c)) On 03/05/13 15:22, Jim - FooBar(); wrote: something like this perhaps? (loop [[c more]] cards res [] due 100] (if-not c res (recur more (conj res

Re: More idiomatic way to use map like this?

2013-05-03 Thread Jim - FooBar();
I Just realised you've many responses and that you've already solved your problem...sorry for the noise people. Jim On 03/05/13 15:38, Jim - FooBar(); wrote: oops there is a typo! line 6 should be: (conj res (doto c (.setAppliedBalance (max 0 (- due (.getBalance c)) On 03/05/13

Re: [ANN] http-kit 2.0.0 released

2013-05-03 Thread Feng Shen
Hi, just released 2.1.0. [http-kit 2.1.0] ; Add to your project.clj. Compare to 2.0.0, noticeable changes: 1. Much faster: about 30%~80% faster. 2. The client support HTTPS now 3. :as option to do client output coercion Not that noticeable changes: 1. few minor bugs fixes

Re: [GSoC] Update: student proposal deadline; mentors, please sign up

2013-05-03 Thread Paul deGrandis
I'm a little behind the ball on my GSoC effort, but if you approve my mentor request, I'll happily go through the projects. Once I was interested in mentoring, I had to Start a connection with the Clojure organization. Regards Paul // ohpauleez On Friday, May 3, 2013 7:20:47 AM UTC-7, Daniel

Re: Clojurians in Austria

2013-05-03 Thread Carlos Fontes
Hi! Such a beautiful and romantic city, Vienna is. This clojure developer must be really lucky. On Thursday, May 2, 2013 10:42:55 AM UTC+1, Haymo Meran wrote: Hey Jozef and others, I am looking for a clojure developer for a project or even employment. The company is a well funded startup

Re: A JMonkeyEngine3 wrapper?

2013-05-03 Thread Robert Louis McIntyre
I've written some JME3 wrapper code for my thesis project -- it's not ready for prime time, but it's got some nice ideas. The design goal is to try and make my thesis code concise instead of being a general purpose library, but one idea I like it to build a world out of clojure functions that do

Re: More idiomatic way to use map like this?

2013-05-03 Thread Alan Thompson
Hey Armando - How did you get the nice syntax highlighting into your post??? Enquiring minds wanna know. Alan On Fri, May 3, 2013 at 7:41 AM, Jim - FooBar(); jimpil1...@gmail.com wrote: I Just realised you've many responses and that you've already solved your problem...sorry for the noise

Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
Hello all, I have a question regarding the default values when destructuring with :keys Let's assume that we have the following function: *(defn my-function [{:keys [my-key] :or {my-key 5} :as params}] (str my-key value is (:my-key params)))* A few test runs: *user= (my-function

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Anthony Rosequist
The value of :my-key (or the default, if :my-key doesn't exist) is being bound to the symbol my-key, so all you need to do is this: (defn my-function [{:keys [my-key] :or {my-key 5} :as params}] * (str my-key value is my-key))* On Friday, May 3, 2013 1:52:46 PM UTC-5, Ryan wrote: Hello

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
Thanks Anthony for your reply but I was already aware of that. I was hoping for some solution which would took care of the binding if *:as* was provided and would append the key-value to the *:as* parameter. I probably need to do that myselfbut you never know, someone else might have done

[OT] Re: More idiomatic way to use map like this?

2013-05-03 Thread Cedric Greevey
On Fri, May 3, 2013 at 2:32 PM, Alan Thompson thompson2...@gmail.comwrote: Hey Armando - How did you get the nice syntax highlighting into your post??? Enquiring minds wanna know. Alan If the OP's problem is solved anyway, I suppose we can go OT a bit with this thread now. AFAIK, it's

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Sean Corfield
The :as key binds the entire _original_ map. The :or defaults apply only to the bound variables extracted from the map. It caught me out when I first used map destructuring but I soon got used to it. On Fri, May 3, 2013 at 12:08 PM, Ryan arekand...@gmail.com wrote: Thanks Anthony for your

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
Well, I need to do something more clever because I am passing the whole map to another function which does validation on the key-value pairs. Soi guess I need to append those default associations to the original map myself... Something like... *(defn my-function [{:keys [my-key] :or

Re: Iota, reducers, word counting

2013-05-03 Thread Catonano
Well I reply to myself: with pmap there´s no need to explicitly calculate the batches The final version of the code is: (defn parallel-count [iota-file] (reduce (partial merge-with +) (pmap (fn [a-subcollection] (frequencies (words a-subcollection)))

Re: http-kit 2.0.0 released

2013-05-03 Thread Shantanu Kumar
Congratulations on the release! Could you please let me know whether HTTP-Kit has built-in support for applying backpressure, and if it does then how to configure the same? Shantanu On May 3, 9:05 pm, Feng Shen shen...@gmail.com wrote: Hi, just released 2.1.0. [http-kit 2.1.0] ; Add to your

Re: [OT] Re: More idiomatic way to use map like this?

2013-05-03 Thread Robert Pitts
Armando was a good citizen and sent along a plain-text version as well – https://groups.google.com/group/clojure/msg/6aae8287bc55d436?dmode=sourceoutput=gplainnoredirect Would still be nifty to know if there's an easy way to do this, Armando :) On Friday, May 3, 2013 3:19:48 PM UTC-4, Cedric

Re: [ANN] http-kit 2.0.0 released

2013-05-03 Thread Michael Klishin
2013/5/3 Feng Shen shen...@gmail.com Compare to 2.0.0, noticeable changes: 1. Much faster: about 30%~80% faster. 2. The client support HTTPS now 3. :as option to do client output coercion Not that noticeable changes: 1. few minor bugs fixes 2. less RAM usage The full

[ANN] Pedestal 0.1.6 released

2013-05-03 Thread Ryan Neufeld
Hey Folks, We've just released the 0.1.6 versions of the Pedestal libraries. This release brings the ability to match port numbers in service routes as well as further compatibility for JBoss. You'll find the full changelog for this and other changes here: http://git.io/dHCnJQ. - Ryan and

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Stanislas Nanchen
What about merging with a default map? (defn my-function [params] (let [params (merge {:my-key 5} params)] (str my-key value is (:my-key params Well, I need to do something more clever because I am passing the whole map to another function which does validation on the key-value

Re: More idiomatic way to use map like this?

2013-05-03 Thread Armando Blancas
Having failed many attempts, I asked Feng Shen and he kindly told me how: copy some formatted text off a browser and simply paste it on this editor box. So I made a gist and instead of putting this link https://gist.github.com/blancas/5507033 I just pasted the text. On Friday, May 3, 2013

Re: [OT] Re: More idiomatic way to use map like this?

2013-05-03 Thread Armando Blancas
On Friday, May 3, 2013 1:15:24 PM UTC-7, Robert Pitts wrote: Armando was a good citizen and sent along a plain-text version as well – https://groups.google.com/group/clojure/msg/6aae8287bc55d436?dmode=sourceoutput=gplainnoredirect That must have been Google Groups doing the right thing...

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Ryan
Ah, the default nap is a nice idea :) -- -- 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

ANN: ClojureScript release 0.0-1798

2013-05-03 Thread David Nolen
artifact: http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1798%7Cjar Git log: https://github.com/clojure/clojurescript/compare/r1586...r1798 Enhancements * Code size improvements, (.log js/console Hello world!) now generates ~100 LOC of pretty printed

[ANN] rhizome - simple graph and tree visualizations

2013-05-03 Thread Zach Tellman
I've had Graphviz integration in Lamina for a while [1], and have generally found it to be fun and useful. To let everyone join in the fun, I've extracted that functionality into its own library, Rhizome [2]. Feedback is welcome. Zach [1] https://github.com/ztellman/lamina/wiki/Channels [2]

Re: [ANN] http-kit 2.0.0 released

2013-05-03 Thread László Török
Hi, regarding the perf. improvements, is it client or server? Thx Las 2013/5/3 Michael Klishin michael.s.klis...@gmail.com 2013/5/3 Feng Shen shen...@gmail.com Compare to 2.0.0, noticeable changes: 1. Much faster: about 30%~80% faster. 2. The client support HTTPS now 3. :as

Re: ANN: ClojureScript release 0.0-1798

2013-05-03 Thread David Nolen
Forgot to add CLJS now depends on Clojure 1.5.1 and data.json 0.2.2. On Friday, May 3, 2013, David Nolen wrote: artifact: http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1798%7Cjar Git log: https://github.com/clojure/clojurescript/compare/r1586...r1798

Re: Question about destructuring with :keys :or and :as

2013-05-03 Thread Sean Corfield
Just merge the new, known values back in since they've already been bound to their (possibly defaulted) values: (let [params (assoc params :my-key my-key)] ...) Sean On Fri, May 3, 2013 at 12:38 PM, Ryan arekand...@gmail.com wrote: Well, I need to do something more clever because I am passing

[ANN] java.jdbc 0.3.0-alpha2

2013-05-03 Thread Sean Corfield
Another step toward the 0.3.0 release for Clojure's JDBC wrapper. A very minor update, mostly bug fixes and consistency issues. Based on feedback from some users, the new boolean transaction? argument in some of the new API functions will probably change in alpha3 although that's not fully decided

Re: ANN: vim-redl -- advanced fuzzy omnicompletion and VimClojure-style repl with enhanced debugging features

2013-05-03 Thread Paulo Suzart
Now it is perferct! Great tool. On 2 May 2013 22:04, Ryan Stradling ryanstradl...@gmail.com wrote: Make sure to have vimfireplace installed and a repl up and going for the project. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: [ANN] http-kit 2.0.0 released

2013-05-03 Thread Shen, Feng
regarding the perf. improvements, is it client or server? It's the server. Due to IO model change: One IO thread (reading and writing) = One thread reading, decoding + many threads writing 沈锋 On Sat, May 4, 2013 at 7:54 AM, László Török ltoro...@gmail.com wrote: Hi, regarding the perf.

Re: http-kit 2.0.0 released

2013-05-03 Thread Shen, Feng
Could you please let me know whether HTTP-Kit has built-in support for applying backpressure, and if it does then how to configure the same If the backpressure is something like this: http://mechanical-sympathy.blogspot.jp/2012/05/apply-back-pressure-when-overloaded.html Then yes. http-kit

[ANN] lein-clique - Function dependency graph generator

2013-05-03 Thread Matthew
This is a tool for generating dependency graphs of functions used by functions. It goes through the source of functions and resolves any symbols in external namespaces, collecting a graph of which functions use which other functions. The result is a dotviz file to be layed-out and analyzed in

Re: [OT] Re: More idiomatic way to use map like this?

2013-05-03 Thread Timothy Baldridge
In general, loop/recur shouldn't be considered idiomatic, IMO. Instead, try for a more functional style: due = 100 cards = cards.map do |card| card.applied_balance = max(0, due - card.balance) due -= card.applied_balance becomes (untested): (defn apply-balance-1 [{:keys [due] :as accum}

Re: [OT] Re: More idiomatic way to use map like this?

2013-05-03 Thread Alex Baranosky
I concur with Timothy's assessment. Really well stated and illustrated use of reduce with a named reduce function. On Fri, May 3, 2013 at 10:52 PM, Timothy Baldridge tbaldri...@gmail.comwrote: In general, loop/recur shouldn't be considered idiomatic, IMO. Instead, try for a more functional