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

2016-09-14 Thread joakim . tengstrand
(ns spec-test.core (:require [clojure.spec :as s])) (s/def :user/name string?) (s/def :common/user (s/keys :req [:user/name])) ; first version of name (using :pre) (defn name [user] {:pre [(s/valid? :common/user user)]} (-> user :user/name)) ; This statement works ok and returns "Elon":

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

2016-09-15 Thread joakim . tengstrand
:pre conditions, that leverage the same amount of details in the error messages, but that is always "turned on". In the meanwhile, I will use s/assert ;-) BR, Joakim Tengstrand On Wednesday, 14 September 2016 15:59:09 UTC+2, Alex Miller wrote: > > Another option that has been

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

2016-09-15 Thread joakim . tengstrand
cuted (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 :pre conditions, that leverage >> the same amount of details in the error messages, but that is always >> "

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

2016-09-15 Thread joakim . tengstrand
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 :pre conditions, that leverage >> the same amount of details in the error messages, but that is always >> "turne

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

2016-09-16 Thread joakim . tengstrand
Shantanu >>> >>> On Thursday, 15 September 2016 16:50:17 UTC+5:30, joakim.t...@nova.com >>> wrote: >>>> >>>> Ok, thanks! >>>> >>>> In the Java world, the assertions is also something that need to be >>>> turn on exp

clojure.spec - suggestion on how to simplify :pre and :post conditions by using specs.

2016-09-16 Thread joakim . tengstrand
(ns spec-test.core (:require [clojure.spec :as s])) (s/def :user/name string?) (s/def :core/user (s/keys :req [:user/name])) ; A helper method to get better error messages. ; Also imagine that clojure.spec has a similar s/check ; function that looks similar to this one ; (used in our user-nam

Re: clojure.spec - suggestion on how to simplify :pre and :post conditions by using specs.

2016-09-16 Thread joakim . tengstrand
I think a natural place of the :post condition shold be after the argument brackets (and that should be possible to implement I think): (defn user-name [user :core/user] :user/name (-> user :user/name)) On Friday, September 16, 2016 at 1:34:47 PM UTC+2, joakim.t...@nova.com wrote: > > (ns sp

The Micro Monolith architecture

2016-12-28 Thread Joakim Tengstrand
I have just released a new architecture that fits really nice with Clojure and its REPL. Start the REPL once and continue working! https://medium.com/@joakimtengstrand/the-micro-monolith-architecture-d135d9cafbe#.v934khjni -- You received this message because you are subscribed to the Google Gro

Re: component dependency cleanup problem

2017-01-20 Thread joakim . tengstrand
Hi there! Another solution is to use the Micro Monolith Architecture to solve dependency problems which also gets you a really awesome development experience! https://medium.com/@joakimtengstrand/the-micro-monolith-architecture-d135d9cafbe#.z7gjrqoif On Wednesday, January 18, 2017 at 3:28:24 PM

[ANN] Polylith: A software architecture based on Lego-like blocks

2018-10-04 Thread Joakim Tengstrand
Polylith is an architecture that has been inspired by the simplicity and composability of functions. We asked ourselves the question "what would a system look like if we could build it with high-level blocks that share the properties of functions?". It turned out that the answer looks a lot lik