Re: soft question: should remote channels appear like local channels

2014-01-31 Thread Cedric Greevey
You do need to handle connection loss in some way, which is never a concern with purely local channels. The middle level needs to detect a broken connection (as distinct from a full buffer on put or an empty one on take) and signal it somehow (OOB value, exception, put to a control channel, or etc.

Re: ANN: Another binary parser combinator - this time for java's streams

2014-01-31 Thread Steffen Dienst
Thanks, I fixed the documentation issues. Feel free to share your id3 tags parser, if you like :) You can see that mine is still stuck at the very beginning.. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: When should I use non-blocking >! / threads and blocking >!! / goroutines with clojure core.async

2014-01-31 Thread Jozef Wagner
Thank you for the clarification. If I understand it correctly, these callbacks in case of go 'threads' resume the parked state machine, so if there is a blocking IO inside go block, it ends up waiting in one of these callbacks, thus tying up a thread from a fixed sized pool until IO operation u

Re: David Nolen's sudoku solver not compatible with Peter Norvig's generator?

2014-01-31 Thread Jim - FooBar();
On 31/01/14 00:47, Norman Richards wrote: I don't know how many solutions there are, but it seems like there are a lot... I think you are just generating all of them and it's taking a long time. spot on!!! I was just being stupid (again)...tried with `first` and worked immediately :) Tha

Re: Integration testing in Clojure

2014-01-31 Thread Nebojša Stričević
Hey, I had success using https://github.com/xeqi/kerodon for integration testing. Cheers, Strika On Thursday, January 30, 2014 10:41:45 PM UTC+1, ronen wrote: > > Hey Conan, I'm using midje with selectors to separate integration test > from unit test (like for example in > this

Re: Recommendations for parsing/validating a JSON structure

2014-01-31 Thread Ivan L
Schema is really awesome. Very easy to use and even though the validation messages are a little cryptic, I think they'll work for libraries. My only irk with it so far is that it appears to modify the function prototype. (extend-protocol Schema js/Function ... Not sure why they need to exte

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread Thomas Heller
Hi, only advice I can give is: no or don't. In the many years I have done web development one of the most important things I have learned is to keep the server as stateless as possible. Data is easily kept externally while channels are not. Channels also aren't exactly simple state since they

Re: Integration testing in Clojure

2014-01-31 Thread mynomoto
You could also use https://github.com/semperos/clj-webdriver for integration testing. On Wednesday, January 29, 2014 1:47:15 PM UTC-2, Conan Cook wrote: > > Hi, I'm trying to decide how we should go about testing our services that > are written in Clojure. I'm used to doing this using Maven, wh

Re: [ANN] clj-refactor.el 0.10.0

2014-01-31 Thread Akhil Wali
Great job by the clj-refactor.el team!! Really nice additions. On Thursday, January 30, 2014 6:43:36 PM UTC+5:30, Magnar Sveen wrote: > > clj-refactor.el > Since the last update, there's been lots of activity for > clj-refactor.el > . Alex Baranosky

Re: Integration testing in Clojure

2014-01-31 Thread Conan Cook
Thanks for the suggstions! I've managed to fire up my app just using midje's (against-background) macro, and am hitting an H2 database as well. @ronen That cartridge library looks like just the ticket for taking the last bits offline, I'll give it a shot next week! @Nebojša/mynomoto I'll pas

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread Timothy Baldridge
A quick thought...there really isn't much of a difference between a failing network connection and a (chan (dropping-buffer 1024)) Both may (or may not) drop information that you put into them, but also, both can be expected to work "normally" as long as certain conditions hold. Namely, the net co

Should predicates always have one argument?

2014-01-31 Thread Ryan
Hello, I am wondering if all my predicates should be one argument functions because I run into a couple of cases where I needed more than one. For example, I have a function called valid-params? which takes two parameters; the validator to use and a maps parameter. Is this approach wrong/not th

Re: Should predicates always have one argument?

2014-01-31 Thread Andy Fingerhut
While most of the functions and macros in Clojure core with a ? at the end take 1 arg, there are several that take two: contains? every? extends? identical? instance? not-any? not-every? satisfies? That list might not be complete. But you would not be breaking any traditions I know of to have mu

Re: Should predicates always have one argument?

2014-01-31 Thread Jim - FooBar();
A predicate is something that returns true or false. Nothing more nothing less...you can have as many args as you want - it is still a function predicate :) Jim On 31/01/14 16:44, Ryan wrote: Hello, I am wondering if all my predicates should be one argument functions because I run into a c

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread t x
Originally, I had this mental analogy of: function call :: remote procedure call = local async :: async over websocket In the func vs rpc case, the distinction is important to know what is fast / what requires a network connection. However, upon further reflection, this analogy / distincti

Idiomatic way to construct potentially time bound target channel in core.async

2014-01-31 Thread Jan Herich
Hello Folks, I need to construct core.async channel with following semantics: 1. When the channel is created, timeout is attached to channel 2. After timeout passes out, channel is closed 3. It's possible to detach timeout from the channel before it passes out Now i implemented it with something

[ANN] clojure.java.jdbc 0.3.3 released

2014-01-31 Thread Sean Corfield
clojure.java.jdbc - Clojure's contrib library that wraps JDBC access https://github.com/clojure/java.jdbc • Release 0.3.3 on 2014-01-30 • Prevent exception/crash when query called with bare SQL string JDBC-89. • Add :row-fn and :result-set-fn to metadata-result function JDBC-87. • Support key/

Re: Should predicates always have one argument?

2014-01-31 Thread John Gabriele
It looks like the `comparator` function wants you to give it a 2-arg predicate. -- John On Friday, January 31, 2014 11:55:30 AM UTC-5, Andy Fingerhut wrote: > > While most of the functions and macros in Clojure core with a ? at the end > take 1 arg, there are several that take two: > > contain

Re: Should predicates always have one argument?

2014-01-31 Thread Tassilo Horn
Andy Fingerhut writes: > contains? every? extends? identical? instance? not-any? not-every? > satisfies? > > That list might not be complete. Just to add some more: =, ==, <, <=, >=, > are also predicates with more than one arg and even no question mark at the end. Bye, Tassilo -- You receive

Re: Should predicates always have one argument?

2014-01-31 Thread Ivan L
I typically wrap stuff with (partial) for easier reading. In your example you might use something like following. (defn are-valid [maps validator] (let [valid? (partial validator)] (map valid? maps))) On Friday, January 31, 2014 11:44:38 AM UTC-5, Ryan wrote: > > Hello, > > I am wonderi

Re: [ANN] clojure.java.jdbc 0.3.3 released

2014-01-31 Thread Mark Engelberg
I've been having trouble figuring out how to use clojure.java.jdbc effectively, for example, how to rename tables, do work in transactions, etc. Is there full documentation with examples somewhere? On Fri, Jan 31, 2014 at 11:33 AM, Sean Corfield wrote: > clojure.java.jdbc - Clojure's contrib l

Re: [ANN] clojure.java.jdbc 0.3.3 released

2014-01-31 Thread mynomoto
The docs are in http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html. There is also a group: https://groups.google.com/forum/#!forum/clojure-java-jdbc On Friday, January 31, 2014 8:54:12 PM UTC-2, puzzler wrote: > > I've been having trouble figuring out how to use clojure.java.jdbc >

Re: order of returned values from keys and vals

2014-01-31 Thread Matching Socks
Actually, http://dev.clojure.org/jira/browse/CLJ-1302 "keys and vals consistency not mentioned in docstring" was declined, with the comment "The absence of this property in the docs is correct. You should not rely on this." On Wednesday, August 11, 2010 6:03:39 PM UTC-4, Chouser wrote: > > On

Re: [ANN] clojure.java.jdbc 0.3.3 released

2014-01-31 Thread Sean Corfield
On Fri, Jan 31, 2014 at 2:54 PM, Mark Engelberg wrote: > I've been having trouble figuring out how to use clojure.java.jdbc > effectively, for example, how to rename tables, do work in transactions, > etc. Is there full documentation with examples somewhere? Feel free to ask specific questions -

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread Sean Corfield
I like that way of thinking, Timothy! Thomas: it's very specifically two separate channels; on the client side, code puts data on a channel and additional client code (in a library) takes data off the channel and handles the client/server communication; on the server side, a library reads data fro