Re: User input validations, design doubt

2017-02-08 Thread Herwig Hochleitner
Of course, for performance you can optimize that apply+hash-map+interleave (or even your reduce) into reduce+transients, e.g. by using map-vals .​ -- You received this message because you are

Re: User input validations, design doubt

2017-02-08 Thread Herwig Hochleitner
2017-02-08 23:14 GMT+01:00 Rastko Soskic : > (let [fns [(fn ([] :empty) ([x] "x")) (fn ([] :format) ([y] "y"))] val > "field value"] > (reduce #(assoc % (%2) (%2 val)) {} fns)) The advantage in this approach is that you can get the keys from a set of validators, but you still

Re: Vars as global thread-locals?

2017-02-08 Thread Ernesto Garcia
Hi Alex, thanks for your thorough response. It seems to me that Clojure vars are just not intended to be used as thread-locals in general. They happen to use thread-local storage in order to implement dynamic scoping, which is the original intent. That is why vars are either global (interned

User input validations, design doubt

2017-02-08 Thread Rastko Soskic
Hi everyone, this is simply question for of course opinionated views of my approach. I have some user input (nevertheless where it comes from, web form input, rich client... whatever). Single field can be (as usual) "equipped" with couple of validations, empty, format, strength (if it is about

Re: How to disable (or limit) test.check shrinking

2017-02-08 Thread Daniel Compton
If the 503 is only returned by failures not relating to what you are testing (e.g. load), then one option might be to catch the exception and retry that request? On Thu, Feb 9, 2017 at 6:48 AM 'Matt Bossenbroek' via Clojure < clojure@googlegroups.com> wrote: > I'm using test.check to test a live

How to disable (or limit) test.check shrinking

2017-02-08 Thread 'Matt Bossenbroek' via Clojure
I'm using test.check to test a live service. Occasionally it gets a 503 from the service and spends hours trying to shrink the input & reproduce the error. Is there a way to limit the shrinking process to n iterations? Or disable it entirely for some tests? Is there a better approach for

Re: Vars as global thread-locals?

2017-02-08 Thread Alex Miller
On Wednesday, February 8, 2017 at 8:34:06 AM UTC-6, Ernesto Garcia wrote: > > https://clojure.org/reference/vars says > > Clojure is a practical language that recognizes the occasional need to >> maintain a persistent reference to a changing value and provides 4 distinct >> mechanisms for

Looking for new maintainer for "fs"

2017-02-08 Thread Miki
Hi There, We're looking for a new maintainer for "fs". See https://github.com/Raynes/fs/issues/106 and https://github.com/clojars/clojars-web/issues/618 for context. If you're able and willing, please ping me. Thanks, -- Miki -- You received this message because you are subscribed to the

Vars as global thread-locals?

2017-02-08 Thread Ernesto Garcia
https://clojure.org/reference/vars says Clojure is a practical language that recognizes the occasional need to > maintain a persistent reference to a changing value and provides 4 distinct > mechanisms for doing so in a controlled manner - Vars, Refs, Agents and > Atoms. Vars provide a

Re: Tentacles; Going Forward

2017-02-08 Thread Chas Emerick
I only became aware of this conversation yesterday; hopefully no one was looking for my reply earlier… Anthony was a friend, but our project activity was quite separate. I think we had a couple of PRs on each other's projects, but that's about it. I don't think I have any particular authority