How to supress warning when including cljx?

2014-11-27 Thread Colin Yates
I have included cljx and everytime lein starts it gives the following:

[code]
WARNING!!! version ranges found for:
[com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
- [org.clojure/clojure [1.3.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
[org.clojure/clojure]].
[com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
- [net.cgrand/regex 1.1.0] - [org.clojure/clojure [1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
[org.clojure/clojure]].
[com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
- [net.cgrand/parsley 0.9.1] - [org.clojure/clojure [1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
[org.clojure/clojure]].
[com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
- [net.cgrand/parsley 0.9.1] - [net.cgrand/regex 1.1.0] - 
[org.clojure/clojure [1.2.0,)]
Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
[org.clojure/clojure]].
[/code]

Great, nice that it is being helpful, the problem is I am using the 
exclusions :).

Any suggestions?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to supress warning when including cljx?

2014-11-27 Thread r0man
It's a bug in cljx related to the middleware I think. Try this one:
[org.clojars.cemerick/cljx 0.5.0-SNAPSHOT]

On Thursday, November 27, 2014 12:22:54 PM UTC+1, Colin Yates wrote:

 I have included cljx and everytime lein starts it gives the following:

 [code]
 WARNING!!! version ranges found for:
 [com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
 - [org.clojure/clojure [1.3.0,)]
 Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
 [org.clojure/clojure]].
 [com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
 - [net.cgrand/regex 1.1.0] - [org.clojure/clojure [1.2.0,)]
 Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
 [org.clojure/clojure]].
 [com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
 - [net.cgrand/parsley 0.9.1] - [org.clojure/clojure [1.2.0,)]
 Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
 [org.clojure/clojure]].
 [com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] 
 - [net.cgrand/parsley 0.9.1] - [net.cgrand/regex 1.1.0] - 
 [org.clojure/clojure [1.2.0,)]
 Consider using [com.keminglabs/cljx 0.4.0 :exclusions 
 [org.clojure/clojure]].
 [/code]

 Great, nice that it is being helpful, the problem is I am using the 
 exclusions :).

 Any suggestions?


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ring jetty adaptor: any way to abort on unrecoverable error?

2014-11-27 Thread Karsten Schmidt
Would this maybe help?

(try
  (run-jetty handler {:port 8080})
  (catch java.net.BindException e
(println Can't launch jetty: (.getMessage e))
(System/exit 1)))


On 27 November 2014 at 03:51, Brian Craft craft.br...@gmail.com wrote:
 If jetty fails to bind a port because it's in use an exception is thrown,
 but the app keeps running. A bunch of jetty threads are created in spite of
 having no port to listen on, and they burn cpu.

 How can I have it exit on unrecoverable errors?

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wouldn't it be nice if if-let allowed more bindings?

2014-11-27 Thread Fluid Dynamics
On Wednesday, November 26, 2014 10:06:41 PM UTC-5, Michael Blume wrote:

 Instead of the deshadowing logic, why not 

 (defn if-and-let*
   [bindings then-clause else-fn-name]
   (if (empty? bindings)
 then-clause
 `(if-let ~(vec (take 2 bindings))
~(if-and-let* (drop 2 bindings) then-clause else-fn-name)
(~else-fn-name

 (defmacro if-and-let
   [bindings then-clause else-clause]
   (let [efname (gensym)]
 `(let [~efname (fn [] ~else-clause)]
~(if-and-let* bindings then-clause efname


That ought to work too, but in a way it does the same basic thing, just 
relying on fn to capture the lexical bindings in effect.

I think it might have more overhead, though, including that it constructs 
an object at runtime for the else clause closure which may or may not even 
be needed. I'm not sure what the overhead of a bunch of lets is, or of 
no-op pairs of let such as (let [x y] ... (let [y x] ... y)), though. 
Perhaps someone can run speed tests of both versions under various 
circumstances, see which one the runtime/JIT does a better job of 
optimizing.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clojure / Lisp Developers job listings

2014-11-27 Thread juan.facorro
Hi all, 

I just discovered this list of Clojure job postings thanks to a co-worker 
and just wanted to share with those who might have not heard about it, like 
me until today :P.

http://lispjobs.wordpress.com/

Cheers,

Juan 

On Tuesday, March 9, 2010 1:00:15 PM UTC-3, Will Fitzgerald wrote:

 Hello,

 I maintain a (free) listing of Lisp and Clojure jobs at
 lispjobs.wordpress.com

 If you have a Clojure job you'd like to advertise, please send it to
 one of the addresses found on the About page:

 http://lispjobs.wordpress.com/about/

 Will Fitzgerald



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any Clojure programming recording around?

2014-11-27 Thread Fernando Varesi
+1 for zombileclj.no

I don't speak a word in Norwegian, but I can follow along since the 
function names are in English. I found those screencasts very useful to 
learn a possible workflow for TDD in clojure.

Fernando.

On Wednesday, November 26, 2014 7:54:41 PM UTC-2, Stig Brautaset wrote:

 I *really* enjoyed http://www.zombieclj.no - but an understanding of 
 Norwegian is required :-)

 Stig

 On Thursday, 20 November 2014 22:05:16 UTC, Erlis Vidal wrote:

 Hi group, 

 Someone knows if we have screencasts on how the more skilled clojurian 
 are working? I remember few months ago we had some pairing sessions that 
 were really popular, any recording on any of those sessions? 

 Usually I learn better by watching/doing than reading. 

 (Any? channel  screencasts training pairing)

 Regards, 
 Erlis 



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] defrecord-wrapper 0.1.3 - wrapping clojure.core/defrecord

2014-11-27 Thread JUAN ANTONIO Ruz
https://github.com/tangrammer/defrecord-wrapper

This library lets you apply middleware to protocol implementations of 
clojure.core/defrecord in the same way as AOP does.

The idea behind defrecord-wrapper is pretty simple. It creates another 
defrecord instance (wrapper) that will contain the original one (wrapped), 
and uses pattern matching (over protocol namespace, function name and 
arguments number) to apply middleware. 

I'm not sure if there is another library with the same proposal or the way 
(clojure.core/extend) to achieve that is ok, so I'm really looking forward 
your comments and suggestions


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] FFDC - A template for chestnut / friend / friendui / datomic and reactive

2014-11-27 Thread Sven Richter
Hi:

This is the github repo: https://github.com/sveri/ffdc 

From the Readme:

This is a template (not a leiningen) combining several projects to get 
started with. Included are:

   - friend with friendui
   - datomic pro (should be easily replacable by datomic free edition)
   - chestnut template with all the nice reloading stuff
   - freactive instead of om
   - secretary for cljs routing
   - Bootstrap
   - JQuery
   - And some other things
   
This is what I currently basically use when starting a new project. It is 
runnable like this. There might be some errors, so issues and pull requests 
are welcome. Any other hints regarding code style, etc too.

Best Regards,

Sven

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ClojureScript] Re: [ANN] freactive - high performance, pure Clojurescript, declarative DOM library

2014-11-27 Thread Aaron Craelius
So, you've made a good observation about the spec - it doesn't proscribe
any convention for dealing with sequences of items. The reason for this is
pretty much that the DOM is the only modern UI framework that I've worked
with that doesn't include something like an items view. So, I understand
that an items view may seem like a hackish solution, but from my
perspective, it's actually the least hackish solution. I think something
like React's key resolution is much more hackish. That said, I have
actually been thinking about implementing something along the lines of what
React is doing with keys because I see its use case and it wouldn't be that
hard.

In any event, this is a good item for discussion.

On Thu, Nov 27, 2014 at 1:40 AM, Ruslan Prokopchuk fer.ob...@gmail.com
wrote:

 I've noticed that you did not mention Items View in UI-SPEC and describe
 it as something orthogonal in freactive readme. Yes, it is really could be
 implemented independently, and yes, it must be decoupled from core. But it
 reveals drawback in abstract spec — how in terms of UI-SPEC model list of
 items should be rendered? Current model only supports full rerender, you
 need items view hackery to overcome this and apply changes only where data
 has been changed. But dynamic lists of things is so common case, so spec
 should contain conceptual key to solve it without additional entities such
 as items view with its own magic. I'm not sure I have solution right now,
 but I think it is thing worth to think about.

 But, m.b., I am not right, and lists should stay opaque for reactive
 model. Don't know, let's discuss.

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups ClojureScript group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojurescript/99myJ9vLeKQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] java-jdbc/dsl 0.1.1

2014-11-27 Thread Sean Corfield
What?
A basic SQL DSL (that was briefly part of org.clojure/java.jdbc).
Version 0.1.1

Where?
https://github.com/seancorfield/jsql
https://clojars.org/java-jdbc/dsl

Changes?
Add support for WHERE .. IN ( .. ) as (where :col [val1, val2, val3])
Courtesy of Dmitry Balakhonskiy - thank you!

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Core.async unordered pipeline-blocking ?

2014-11-27 Thread Niels van Klaveren
Recently in creating load testing I've been in need of throttling certain 
mixed IO/CPU bound processes and have been using claypoole.core/upmap for 
those situations

(require '[com.climate.claypoole :as cp])

(defn wait-and-return
  [w]
  (Thread/sleep (* 1000 w))
  w)

(def to-sort
  [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10])

(def timesorted
  (time (doall (cp/upmap 20 wait-and-return to-sort

timesorted
Elapsed time: 38004.512729 msecs
= (var clay.core/timesorted)
= (0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38)


This is just an example to show blocking processes returning in a different 
order, while being restricted to a certain number of threads. I know this 
won't work with a threadpool smaller than to-sort.

Other parts of these tests would benefit from core.async techniques, but I 
haven't found a satisfactory combination of the two. What I'm really 
looking for is a way to use core.async pipeline-blocking syntax, which 
takes a fixed number of parallel processes, a from channel, a transducer 
and a to channel, but returns the results from the transducers unordered 
(ie. fasted delivered first. Something like this, but with an ordered 
outcome.

(require '[clojure.core.async :as a])

(def to-sort
  (a/to-chan [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10]))

(defn wait-and-return
  [w]
  (Thread/sleep (* 1000 w))
  w)

(def sorted
  (a/chan))

(def xwait
  (map wait-and-return))

(def sorter
  (a/pipeline-blocking 20 sorted xwait to-sort))

(time (a/!! (a/into [] sorted)))


Is there a function like that, or would there be a recommended way to do 
something like this in core.async ?

Regards,

Niels

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Core.async unordered pipeline-blocking ?

2014-11-27 Thread Timothy Baldridge
This wasn't included in core.async mostly because it's fairly easy to
write. The code looks something like this (untested):

(def from-chan)
(def to-chan)

(dotimes [_ num-threads]
  (let [rf (fn [_ x] (!! to-chan))
 f (xform rf)]
(thread
  (loop []
(when-some [x (!! from-chan)]
  (f x))

I'll leave it up to you to decide when to terminate or how to shut things
down.

Timothy Baldridge

On Thu, Nov 27, 2014 at 2:32 PM, Niels van Klaveren 
niels.vanklave...@gmail.com wrote:

 Recently in creating load testing I've been in need of throttling certain
 mixed IO/CPU bound processes and have been using claypoole.core/upmap for
 those situations

 (require '[com.climate.claypoole :as cp])

 (defn wait-and-return
   [w]
   (Thread/sleep (* 1000 w))
   w)

 (def to-sort
   [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10])

 (def timesorted
   (time (doall (cp/upmap 20 wait-and-return to-sort

 timesorted
 Elapsed time: 38004.512729 msecs
 = (var clay.core/timesorted)
 = (0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38)


 This is just an example to show blocking processes returning in a
 different order, while being restricted to a certain number of threads. I
 know this won't work with a threadpool smaller than to-sort.

 Other parts of these tests would benefit from core.async techniques, but I
 haven't found a satisfactory combination of the two. What I'm really
 looking for is a way to use core.async pipeline-blocking syntax, which
 takes a fixed number of parallel processes, a from channel, a transducer
 and a to channel, but returns the results from the transducers unordered
 (ie. fasted delivered first. Something like this, but with an ordered
 outcome.

 (require '[clojure.core.async :as a])

 (def to-sort
   (a/to-chan [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10]))

 (defn wait-and-return
   [w]
   (Thread/sleep (* 1000 w))
   w)

 (def sorted
   (a/chan))

 (def xwait
   (map wait-and-return))

 (def sorter
   (a/pipeline-blocking 20 sorted xwait to-sort))

 (time (a/!! (a/into [] sorted)))


 Is there a function like that, or would there be a recommended way to do
 something like this in core.async ?

 Regards,

 Niels

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Core.async unordered pipeline-blocking ?

2014-11-27 Thread Timothy Baldridge
eh, that one line should be:

(let [rf (fn [_ x] (!! to-chan x)) ...)

On Thu, Nov 27, 2014 at 3:15 PM, Timothy Baldridge tbaldri...@gmail.com
wrote:

 This wasn't included in core.async mostly because it's fairly easy to
 write. The code looks something like this (untested):

 (def from-chan)
 (def to-chan)

 (dotimes [_ num-threads]
   (let [rf (fn [_ x] (!! to-chan))
  f (xform rf)]
 (thread
   (loop []
 (when-some [x (!! from-chan)]
   (f x))

 I'll leave it up to you to decide when to terminate or how to shut things
 down.

 Timothy Baldridge

 On Thu, Nov 27, 2014 at 2:32 PM, Niels van Klaveren 
 niels.vanklave...@gmail.com wrote:

 Recently in creating load testing I've been in need of throttling certain
 mixed IO/CPU bound processes and have been using claypoole.core/upmap
 for those situations

 (require '[com.climate.claypoole :as cp])

 (defn wait-and-return
   [w]
   (Thread/sleep (* 1000 w))
   w)

 (def to-sort
   [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10])

 (def timesorted
   (time (doall (cp/upmap 20 wait-and-return to-sort

 timesorted
 Elapsed time: 38004.512729 msecs
 = (var clay.core/timesorted)
 = (0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38)


 This is just an example to show blocking processes returning in a
 different order, while being restricted to a certain number of threads. I
 know this won't work with a threadpool smaller than to-sort.

 Other parts of these tests would benefit from core.async techniques, but
 I haven't found a satisfactory combination of the two. What I'm really
 looking for is a way to use core.async pipeline-blocking syntax, which
 takes a fixed number of parallel processes, a from channel, a transducer
 and a to channel, but returns the results from the transducers unordered
 (ie. fasted delivered first. Something like this, but with an ordered
 outcome.

 (require '[clojure.core.async :as a])

 (def to-sort
   (a/to-chan [38 20 22 24 36 2 30 18 32 0 4 34 14 28 6 16 12 26 8 10]))

 (defn wait-and-return
   [w]
   (Thread/sleep (* 1000 w))
   w)

 (def sorted
   (a/chan))

 (def xwait
   (map wait-and-return))

 (def sorter
   (a/pipeline-blocking 20 sorted xwait to-sort))

 (time (a/!! (a/into [] sorted)))


 Is there a function like that, or would there be a recommended way to do
 something like this in core.async ?

 Regards,

 Niels

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 “One of the main causes of the fall of the Roman Empire was that–lacking
 zero–they had no way to indicate successful termination of their C
 programs.”
 (Robert Firth)




-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] stateful-check 0.1.0 - test stateful systems with test.check

2014-11-27 Thread Carlo Zancanaro
I've been working on a library for a little bit which I'm calling
stateful-check (at least for now). It's mainly my attempt to work
towards the sort of stateful testing that I first saw in John Hughes'
talk Testing the Hard Stuff and Staying Sane[1].

  https://github.com/czan/stateful-check
  https://clojars.org/org.clojars.czan/stateful-check

Thus far I've only got it to perform single threaded operations, but I'm
hoping to enhance it in future to do the sort of concurrent tests that
are shown in the talk (although I'm not exactly sure how I'm going to do
that yet).

Anyway, I'm releasing this now in the hopes that somebody finds it
useful!

Carlo


[1]: https://www.youtube.com/watch?v=zi0rHwfiX1Q

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature