(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":
: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
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
>> "
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
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
(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
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
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
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
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
10 matches
Mail list logo