Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread Mamun
When function is throwing exception because of argument. I would prefer to throw IllegalArgumentException not AssertionError. (defn check [type data] (if (sp/valid? type data) true (throw (IllegalArgumentException. (sp/explain type data) Br, Mamun On Friday, September 16,

Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread joakim . tengstrand
I came up with this solution: (ns spec-test.core (:require [clojure.spec :as s])) (s/def :user/name string?) (s/def :common/user (s/keys :req [:user/name])) ;; with this little helper function... (defn check [type data] (if (s/valid? type data) true (throw (AssertionError.

Re: [CfP] :clojureD 2017

2016-09-15 Thread Mars0i
Glad that this is happening. You might want to add the date to the CFP and Schedule pages. I only found it on the Press page. On Wednesday, September 14, 2016 at 9:38:09 AM UTC-5, Stefan Kamphausen wrote: > > Dear Clojure-community, > > > Please let me bring the current call for proposals for

Clojure support for Visual Studio Code

2016-09-15 Thread Rick Beerendonk
Great, I like VSCode, so certainly very helpful, thank you. -- 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

Re: Clojure support for Visual Studio Code

2016-09-15 Thread Ikuru Kanuma
Hi Andrey, thanks for sharing this great work! - I did want to try it out on an Ubuntu machine, but simply dragging and dropping seemed to not work. Could you perhaps point to an alternative way to install extensions (First time ever touching vs code, so it is hard for me to even google how to

Re: Encapsulating Sub-Systems with Protocols

2016-09-15 Thread Sean Corfield
Take a look at Stuart Sierra’s talk “Clojure in the Large” from Clojure/West: https://www.infoq.com/presentations/Clojure-Large-scale-patterns-techniques He talks about several techniques for managing boundaries, including protocols. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An

Re: Encapsulating Sub-Systems with Protocols

2016-09-15 Thread Christopher Small
I've used protocols this way. In fact, this pattern meshes quite well with Stuart Sierra's Component lib/pattern. By building system components around protocols, subsystems/components can be made swappable. This is rather integral to the current design of Datsys actually. Of course, as other's

Re: Encapsulating Sub-Systems with Protocols

2016-09-15 Thread James Reeves
On 15 September 2016 at 20:50, Cameron Barre wrote: > Has anyone used protocols to create explicit boundaries between the bigger > pieces of their systems? We want to track/control the interactions between > these sub-systems and are considering using protocols to define

Re: Encapsulating Sub-Systems with Protocols

2016-09-15 Thread Gregg Reynolds
On Sep 15, 2016 3:20 PM, "Cameron Barre" wrote: > > Has anyone used protocols to create explicit boundaries between the bigger pieces of their systems? Absolutely. Depending on what you mean by "boundaries between bigger pieces". Clojure itself, for one. Also core.matrix, if

Encapsulating Sub-Systems with Protocols

2016-09-15 Thread Cameron Barre
Has anyone used protocols to create explicit boundaries between the bigger pieces of their systems? We want to track/control the interactions between these sub-systems and are considering using protocols to define public APIs. Is this good practice? Would it be better to simply create our API

Re: Deref Nil

2016-09-15 Thread Tim Gilbert
In this specific case, I might personally use something like: (render-image (some-> product-image-list first deref)) ...or maybe write a little function that does the above. Alternately, in (render-image) you might start out with (if (nil? cursor) (default-image) (code-to-render @cursor)).

Re: Clojure support for Visual Studio Code

2016-09-15 Thread Michael Ball
This looks great, will definitely try it out this weekend! On Thursday, September 15, 2016 at 4:17:38 AM UTC-7, Andrey Lisin wrote: > > Hey guys, > > I've been working on Clojure support for Visual Studio Code text editor > for a while. The first version is very close to the point when it can

Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread joakim . tengstrand
Thanks for the tip! On Thursday, September 15, 2016 at 3:11:32 PM UTC+2, Shantanu Kumar wrote: > > Hi Joakim, > > You might be interested in Paul Stadig's library > https://github.com/pjstadig/assertions that leverages Java's `-ea` > (enable-assertions, which you may want to keep enabled in

Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread Shantanu Kumar
Hi Joakim, You might be interested in Paul Stadig's library https://github.com/pjstadig/assertions that leverages Java's `-ea` (enable-assertions, which you may want to keep enabled in dev) command-line flag. If you have a bunch of things together to assert, you may want to use the

Re: clojure.spec - Using :pre conditions (or not)?

2016-09-15 Thread joakim . tengstrand
Ok, thanks! In the Java world, the assertions is also something that need to be turn on explicitly. In that sence, they are kind of not mandatory to be executed (or at least signals that to the reader of the code). I would be happier if you guys could add another method, that I can use in my

Clojure support for Visual Studio Code

2016-09-15 Thread Andrey Lisin
Hey guys, I've been working on Clojure support for Visual Studio Code text editor for a while. The first version is very close to the point when it can be published to Visual Studio Code marketplace, but I would like to test it a bit more before. Maybe there are Visual Studio Code uses here