Re: Idiomatic way to return a single value from an async function

2014-11-11 Thread Daniel Kersten
You could do both: Make the channel optional. If it's provided, use that and return it. If it's not provided, create a new one and use and return that. This way the caller gets to decide which they wish to use based on who the owner of the channel should be or if the channel should be reused

Re: Idiomatic way to return a single value from an async function

2014-11-11 Thread László Török
+1, this is mostly what we resort to. (defn some-async-func [param-a param-b [out-chan]] (let [ch (or out-chan (chan)] ... ) 2014-11-11 8:53 GMT+00:00 Daniel Kersten dkers...@gmail.com: You could do both: Make the channel optional. If it's provided, use that and return it. If it's

Re: Idiomatic way to return a single value from an async function

2014-11-11 Thread Thomas Heller
Hey, what is your definition of an async function in Clojure? I imagine something something that starts a (go ...), if appropriate you can use the result of (go ...) as the result of the function since that is a channel that will receive the return value of the go block when it dies. (defn

[ANN] cljs-start 1.0.4

2014-11-11 Thread Mimmo Cosenza
Hi all, I just deployed the 0.1.4 release of cljs-start lein-template to create ClojureScript libs with batteries included. https://github.com/magomimmo/cljs-start https://github.com/magomimmo/cljs-start It update all dependencies and plugins to the latest available releases: - clojure 1.6.0

Re: multimethod, record, type, and protocol pitfalls?

2014-11-11 Thread Justin Smith
Helping newcomers to the language on #clojure, I often find the need to use a protocol in reference to it's namespace rather than the namespace of the datatype extending it is a counter-intuitive one for people learning the language. Similar with dispatch methods. Speculatively, I think it has

Clojure CLR Experiences

2014-11-11 Thread Adrian Mowat
Hi All, We are using Clojure on the JVM but one of our .Net developers has asked me whether I have considered using it on the CLR. I haven't tried doing it so I wondered if anyone can share any experiences using Clojure on the CLR? A quick google search suggests the project is still active

Re: Idiomatic way to return a single value from an async function

2014-11-11 Thread Stuart Sierra
Similarly, but I would be explicit about the different arities, to avoid the intermediate sequence created by [arg [option]] and to get errors if there are too many arguments. (defn foo ([input] (foo input (chan 1)) ([input ch] ... do something and put to ch ...)) If your function

Re: Clojure CLR Experiences

2014-11-11 Thread Shantanu Kumar
Not sure why you say that 1.4 is the current version. ClojureCLR releases are here: https://www.nuget.org/packages/Clojure - as of today 1.6.0.1 is the current stable version. Leiningen plugin is here: https://github.com/kumarshantanu/lein-clr Shantanu On Tuesday, 11 November 2014 21:08:58

Re: Map holds on to element being processed

2014-11-11 Thread 'Matt Bossenbroek' via Clojure
Thanks! I was playing around with similar variants last night came up with some that seem to work for one element, but not many. I was seeing a similar result from your version: = (map2 count [(repeat 1e8 stuff) (repeat 1e8 stuff) (repeat 1e8 stuff)]) OutOfMemoryError GC overhead limit

Announcing Smeagol, a very simple wiki engine inspired by Gollum

2014-11-11 Thread Simon Brooke
For a project recently I needed a wiki engine which was simple and easily backed up, but which had authentication. I very much liked Gollum https://github.com/gollum/gollum/wiki, but it does not have authentication, and I thought it would be simpler for me to write a wiki engine from scratch

test.check slow shrinking

2014-11-11 Thread Brian Craft
Using test.check, I'm finding the shrinking to be very, very slow. Running a hundred cases takes a few seconds, unless it hits an error, in which case it takes 40-60 minutes to shrink, and the shrinking is not very effective (resulting test case is much larger than necessary). Sometimes the

Re: Clojure CLR Experiences

2014-11-11 Thread Adrian Mowat
Hi, Thanks for the info and the link to the lein plugin. I checked git hub and the latest branch was 1.4.1. That coupled with this blog  http://clojureclr.blogspot.co.uk suggested the latest version was 1.4. Looks like I missed the crucial link :-) Cheers Adrian — Sent from

Re: ClojureScript and development workflow

2014-11-11 Thread Erlis Vidal
Any update on how to do this from LightTable? On Tue, Sep 11, 2012 at 7:48 PM, Chris Granger ibdk...@gmail.com wrote: FWIW, I'm working on this with Light Table, which removes a lot of the difficulties here - it will be include this script tag and you're ready to go. There's no reason that we

Re: Clojure CLR Experiences

2014-11-11 Thread Aaron
Hi Adrian, I'll share some of my experiences. * Is Clojure CLR production ready? Yes, I have been using it in production for about 2 years now. * Do its version numbers correspond to the core Clojure version numbers? (would it be fair to say the Java version is the core version) It's fair to

(ANN) simple-brepl 0.1.2 released

2014-11-11 Thread James Henderson
Hi all - just a quick note to announce the release of *simple-brepl* 0.1.2. 'simple-brepl', as the name suggests, is a really simple way to connect to ClojureScript browser REPLs. It's built atop Tom Jakubowski's excellent Weasel library, which uses Websockets to communicate with the browser.

Re: Announcing Smeagol, a very simple wiki engine inspired by Gollum

2014-11-11 Thread Simon Brooke
And now the Git integration does exist and does work. Clojure is such a joy - a complete functional Wiki engine in less than eight hours actual coding! Obviously it's alpha quality, and could definitely be improved, but it works now. On Tuesday, 11 November 2014 18:00:18 UTC, Simon Brooke

Re: Clojure CLR Experiences

2014-11-11 Thread Alex Miller
On Tuesday, November 11, 2014 9:38:58 AM UTC-6, Adrian Mowat wrote: * Is it sensible to think in terms of writing platform independent code in the same way as we do with cljx files in ClojureScript? With the feature expressions work we hope to include in 1.7, this will become possible.

Re: Clojure CLR Experiences

2014-11-11 Thread dmiller
Re versions: look at the tags, not the branches. The 1.4.1 branch was anomalous, due to needing to get out a bug fix. On Tuesday, November 11, 2014 2:17:29 PM UTC-6, Aaron wrote: Hi Adrian, I'll share some of my experiences. * Is Clojure CLR production ready? Yes, I have been using it