Re: Russ olsen's Clojure Book

2018-02-26 Thread Juraj Martinka
Hi, Russ! I'm very excited about the book and thank you very much for finishing it. Please, consider adding it to https://clojure.org/community/books. On Wednesday, 24 January 2018 21:19:55 UTC+1, ru...@russolsen.com wrote: > > And as others have pointed out, the book is now available in beta

Re: Transitive spec generation

2018-02-26 Thread Didier
Don't fully understand what you are doing, but when you run test.check, it seems to not always be generating random sample, it'll grow the samples. When you run sample, it'll always start back from the beginning. You can see that by running: (sgen/sample (s/gen ::test) 100) See how the

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Didier
Another question, after installing it, if I run clj and then do: (require '[clojure.spec.aplha :as s]) I get: FileNotFoundException Could not locate clojure/spec/aplha__init.class or clojure/spec/aplha.clj on classpath. clojure.lang.RT.load (RT.java:463) So I have to explicitly add it as a

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Didier
There was a small bug with the install script around the man pages for me on a fresh openSuse Tumbleweed install. /usr/local/share/man/man1 did not exist. Specifically, /usr/local/share/man did not exist, so I had to manually mkdir it first, and re-run the installer, which only checked for the

Re: Transitive spec generation

2018-02-26 Thread James Gatannah
Fairly minimalist example available at https://gist.github.com/jimrthy/21851c52a8cd6b04a31ed08b1d0a7f04 When I call gen/sample from inside a unit test, it seems to pass with flying colors. When I directly eval the gen/sample form or call (manual-check) from the REPL (I checked both CIDER and

Re: Why does the `def-` not exist?

2018-02-26 Thread Timothy Baldridge
I much more prefer putting implementation details into separate namespaces. >From there it's simple to mark them as :no-doc in some documentation tools so that the vars don't get published. That way I can still test all my code, and yet I can commit to only those namespaces that have published

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-26 Thread Simon Belak
I’m a pretty heavy user of spec including a lot of coercion. The way I’ve always done coercion is to enumerate all accepted shapes first and do coercion last. For your example this would be: (s/def ::foo (s/and (s/or :string string? :kw keyword?)

Re: Why does the `def-` not exist?

2018-02-26 Thread Didier
> > I’d even be happy if the default was private for def > I actually prefer private everything by default. Its the public things you want to be reminded to think through carefully. And Var access is pretty straightforward, in case your using a lib and they forgot to make something public you

Re: Why does the `def-` not exist?

2018-02-26 Thread Alex Miller
We're not going to add def-. There is regret over even adding defn-, but we don't take things away... At one point all of the current metadata niceties didn't exist (used to be #^{:private true} some may recall) and defn- seemed worth doing I presume (pre-dates my involvementT). But then that

RE: Why does the `def-` not exist?

2018-02-26 Thread Sean Corfield
Personally, I just don't use private defs at all. Inevitably, you'll have to var-hack them during testing, so at some point I stopped doing so. Interesting. I pretty much never write a private function these days so I use defn but not defn- however, nearly all of my def’s are ^:private except

Re: Why does the `def-` not exist?

2018-02-26 Thread Didier
I don't see a huge problem with adding def- I think its omission relates to the mantra Encapsulation of information is folly. And thus its trying to discourage you from using private state and namespaces as classes? Maybe? -- You received this message because you are subscribed to the Google

Re: Why does the `def-` not exist?

2018-02-26 Thread Gary Trakhman
If you're an emacs user, have you considered Yasnippet? It shouldn't be too hard to add to this: https://github.com/mpenet/clojure-snippets/tree/master/snippets/clojure-mode . Personally, I just don't use private defs at all. Inevitably, you'll have to var-hack them during testing, so at some

Re: Why does the `def-` not exist?

2018-02-26 Thread Leon Grapenthin
I have written enough Clojure so that I can assure you that every few days when I type ^:private again I am still annoyed by it. Not every time, but probably every second or third time. Its just in the way of the prototyping typing (micro-)flow. SHIFT-6 you don't hit so often so you have to

Re: Why does the `def-` not exist?

2018-02-26 Thread Alexander Yakushev
- Not that often. When I know for certain, I add ^:private. Not like it's much more work. If I didn't know ahead of time, I would forget to add the private flag in either case. - Never. - Can't recollect such an event. - A few times. As far as I can tell, people appreciate the metadata approach

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Leon Grapenthin
Thank you Alex. Regarding 1 I don't think I really see why I would want this but it seems interesting. Regarding 2 and everything else I'm really happy with the tool and the docs are great. (My cljs usage with this right now is to just build cp and launch figwheel.) Cljs libs and how this is

Re: Why does the `def-` not exist?

2018-02-26 Thread Leon Grapenthin
- How many times do you just write (def ...) instead of (def ^:private ...) because you are not sure whether you need the definition yet, want to save effort, and then you forget to add ^:private later? - How many times have you implemented def- yourself into your project and then used only

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Alex Miller
On Monday, February 26, 2018 at 10:59:53 AM UTC-6, Leon Grapenthin wrote: > > Thank you for this tool. > > I'm using this for a rather large new project right now and already love > how precise and minimalistic this tool is. Features like -Sverbose, -Stree > and now -Sdescribe are very

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Leon Grapenthin
Thank you for this tool. I'm using this for a rather large new project right now and already love how precise and minimalistic this tool is. Features like -Sverbose, -Stree and now -Sdescribe are very helpful. Although it is probably not intended I don't think we will be using Leiningen and

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-26 Thread Dave Dixon
I've been using the macro below to make "types" in the context of clara-rules, where "type" has a specific semantic. If you're going to do something like this, you definitely should have a very well-defined notion of what "type" means. (defmacro def-derive "Macros to wrap useful pattern

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-26 Thread Alex Miller
Nice! On Monday, February 26, 2018 at 8:47:38 AM UTC-6, Wilker wrote: > > I've written a library that tries to solve this, instead of making > conforms that do coercion, it uses the spec and a separated registry to > conform the value (similar to what spec does to find the generators for a >

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-26 Thread Wilker
I've written a library that tries to solve this, instead of making conforms that do coercion, it uses the spec and a separated registry to conform the value (similar to what spec does to find the generators for a given spec). You can find the library at:

Re: Why does the `def-` not exist?

2018-02-26 Thread Alexander Yakushev
Usually, it is better to use metadata rather than create an exponential explosion of names. Public/private is just one dimension, but you also have static/non-static, dynamic/non-dynamic, etc. Then you have functions, vars, macros, perhaps modified functions (like schema.core/defn). Cartesian

Why does the `def-` not exist?

2018-02-26 Thread Promise.
`defn-` => `defn` 'def-` => `def` -- 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