Re: pre and post assertions, always in the meta data?

2022-02-15 Thread Sean Corfield
Whilst you solved your problem, you didn't get an answer about metadata. There are multiple places metadata can appear in a function definition: dev=> (defn ^{:one true} func (^{:two true} [x] {:three true} x) {:four true}) #'dev/func dev=> (meta #'func) {:one true, :arglists ([x]), :four true,

Re: pre and post assertions, always in the meta data?

2022-02-03 Thread Laws
Hmmm, okay, I was using slingshot/try+ everywhere and then, just once, I used a plain 'try' and forgot to use the correct catch. My fault. On Thursday, February 3, 2022 at 1:56:59 PM UTC-5 Laws wrote: > > I see this old post by Fogus: > > http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

pre and post assertions, always in the meta data?

2022-02-03 Thread Laws
I see this old post by Fogus: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/ With this example: (defn constrained–fn [f x] {:pre [(pos? x)] :post [(= % (* 2 x))]} (f x)) But I see this modern example: https://ostash.dev/posts/2021-07-01-pre-post-conditions/ (defn func ^{:pre