Permalink
Browse files

Making assertions backwards compat.

  • Loading branch information...
fogus committed May 26, 2012
1 parent b548520 commit 0a267a004e558d593b7959c93d2a8b702429f0f6
View
@@ -33,7 +33,7 @@
<dependency>
<groupId>org.clojure</groupId>
<artifactId>core.unify</artifactId>
- <version>0.5.3-SNAPSHOT</version>
+ <version>0.5.3</version>
</dependency>
</dependencies>
View
@@ -1,13 +1,13 @@
(defproject core.contracts "0.0.1"
:description "Contracts programming for Clojure."
:dependencies [[org.clojure/clojure "1.5.0-alpha1"]
- [org.clojure/core.unify "0.5.3-SNAPSHOT"]]
+ [org.clojure/core.unify "0.5.3"]]
:dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]
[jline "0.9.94"]
[swank-clojure "1.4.0"]
[lein-marginalia "0.7.0"]
[lein-multi "1.1.0"]]
- :multi-deps {:all [[org.clojure/core.unify "0.5.2"]]
+ :multi-deps {:all [[org.clojure/core.unify "0.5.3"]]
"1.2" [[org.clojure/clojure "1.2.0"]]
"1.2.1" [[org.clojure/clojure "1.2.1"]]
"1.3" [[org.clojure/clojure "1.3.0"]]
@@ -1,10 +1,11 @@
(ns clojure.core.contracts
"The public contracts programming functions and macros for clojure.core.contracts."
- (:use [clojure.core.contracts.impl.transformers :only (build-contract-fn-body)]))
+ (:use [clojure.core.contracts.impl.transformers :only (build-contract-fn-body)])
+ (:require [clojure.core.contracts.impl.utils :as tools]))
(defmacro contract
[name docstring & constraints]
- (assert (string? docstring) "Sorry, but contracts require docstrings")
+ (tools/assert-w-message (string? docstring) "Sorry, but contracts require docstrings")
`(with-meta
~(build-contract-fn-body name docstring constraints)
@@ -10,10 +10,10 @@
(conj m (keys-apply f ks m)))
-(defmacro ^:private assert-w-message
+(defmacro assert-w-message
[check message]
`(when-not ~check
- (throw (new AssertionError (str "Trammel assertion failed: " ~message "\n"
+ (throw (new AssertionError (str "Assertion failure: " ~message "\n"
(pr-str '~check))))))
(defn check-args!

0 comments on commit 0a267a0

Please sign in to comment.