interstar
interstar

Reputation: 27216

Clojure :post condition doesn't recognise %

I have a Clojure function with a post-condition :

{:post [(s/valid? ::MyQuery %)]}

But I'm getting this error :

Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(polvo/core.clj:45:11)is.

It seems to not know what the % is.

But in every example I can find of Clojure :post that's what it uses to refer to the return value.

Any ideas what's going on?

Upvotes: 0

Views: 97

Answers (1)

Joost Diepenmaat
Joost Diepenmaat

Reputation: 17771

Most likely explanation: your pre/post map is not in the right position.

Upvotes: 3

Related Questions