clojure.spec predicate generator question

2016-11-06 Thread dimitris
Hi all, Without having looked at the test.check internals, I'm trying to figure out roughly what kind of generator function, the following spec will give: (s/def ::predicate (s/fspec :args (s/cat :x any?) :ret boolean?)) So, I'm trying to sort of reverse engineer it on the re

Re: code from spec with clojure.spec?

2016-11-06 Thread Joe Corneli
This is a late reply to my own question but maybe it will be helpful to a future searcher. http://blog.cognitect.com/blog/2016/10/5/interactive-development-with-clojurespec has an example that showed me more clearly how to use :fn. Specifically here's how I rewrote the spec: (s/fdef mapper

Strange behavior Clojure and Null

2016-11-06 Thread Alexey Stepanov
Hello! I experimented with overload resolution. And faced with a strange behavior. https://gist.github.com/alejes/355881c1711224d5a773fbf0275b4898 The Clojure code calls a method from the Java. But at different runs I get the result call different methods (4 and 6). It is a simplified version

any? in clojure 1.9.0 alpha

2016-11-06 Thread waffletower
I find the semantic of the new (any?) function to be in conflict with (not-any?) and a strange addition, at least with the chosen name. This concern has come up on the "clojure dev" group as well. I have found a different implementation of (any?) useful in my own projects: (defn any? [pred

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread James Reeves
On 6 November 2016 at 23:31, waffletower wrote: > I find the semantic of the new (any?) function to be in conflict with > (not-any?) and a strange addition, at least with the chosen name. This > concern has come up on the "clojure dev" group as well. I have found a > different implementation o

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread waffletower
I disagree, the new implementation is a subset of the code I presented. Here is the docstring from 1.9.0-alpha14 (doc any?) - clojure.core/any? ([x]) Returns true given any argument. There isn't a predicate function argument as in (not-any?): (doc not-any?) --

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread Alan Thompson
There was quite a discussion of this topic back in July if you'd like to review it: https://goo.gl/Azy8Nf The semantic mismatch is unfortunate. Alan On Sun, Nov 6, 2016 at 6:47 PM, waffletower wrote: > I disagree, the new implementation is a subset of the code I presented. > Here is the docst

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread Mars0i
On Sunday, November 6, 2016 at 9:54:19 PM UTC-6, Alan Thompson wrote: > > There was quite a discussion of this topic back in July if you'd like to > review it: https://goo.gl/Azy8Nf > > The semantic mismatch is unfortunate. > Alan > It's not just a mismatch with not-any?, though. "any?" makes

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread Mars0i
On Monday, November 7, 2016 at 12:16:28 AM UTC-6, Mars0i wrote: > > "any?" wasn't the only option. I would have gone with something obvious > like "always-true", or "yes", or even something possibly too-clever like > "arg-or-not-arg?" or "or-not-this?" > Or maybe: "argument?" "value?" "is-som