Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move to clojure 1.2

  • Loading branch information...
commit 5f508f908ee49b661712d45c7f32f42265489c30 1 parent 2515a31
@kotarak authored
View
2  build.gradle
@@ -15,7 +15,7 @@ project(':server') {
}
dependencies {
- development 'org.clojure:clojure:1.1.0'
+ development 'org.clojure:clojure:1.2.0'
}
uploadArchives {
View
8 server/src/main/clojure/vimclojure/optional/clj_stacktrace.clj
@@ -22,14 +22,12 @@
(clojure.core/in-ns 'vimclojure.util)
-(require '[clj-stacktrace.repl :as stacktrace])
+(require '[clj-stacktrace.repl :as clj-st])
(defoptional pretty-print-stacktrace
[e]
- (stacktrace/pst e))
+ (clj-st/pst e))
(defoptional pretty-print-causetrace
[e]
- (stacktrace/pst e))
-
-(def stacktrace-printer :clj-stacktrace)
+ (clj-st/pst e))
View
35 server/src/main/clojure/vimclojure/optional/core_stacktrace.clj
@@ -1,35 +0,0 @@
-;-
-; Copyright 2010 (c) Meikel Brandmeyer.
-; All rights reserved.
-;
-; Permission is hereby granted, free of charge, to any person obtaining a copy
-; of this software and associated documentation files (the "Software"), to deal
-; in the Software without restriction, including without limitation the rights
-; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-; copies of the Software, and to permit persons to whom the Software is
-; furnished to do so, subject to the following conditions:
-;
-; The above copyright notice and this permission notice shall be included in
-; all copies or substantial portions of the Software.
-;
-; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-; THE SOFTWARE.
-
-(clojure.core/in-ns 'vimclojure.util)
-
-(require '[clojure.stacktrace :as stacktrace])
-
-(defoptional pretty-print-stacktrace
- [e]
- (stacktrace/print-stack-trace e))
-
-(defoptional pretty-print-causetrace
- [e]
- (stacktrace/print-cause-trace e))
-
-(def stacktrace-printer :clojure.stacktrace)
View
34 server/src/main/clojure/vimclojure/optional/prettyprint.clj
@@ -1,34 +0,0 @@
-;-
-; Copyright 2009 (c) Meikel Brandmeyer.
-; All rights reserved.
-;
-; Permission is hereby granted, free of charge, to any person obtaining a copy
-; of this software and associated documentation files (the "Software"), to deal
-; in the Software without restriction, including without limitation the rights
-; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-; copies of the Software, and to permit persons to whom the Software is
-; furnished to do so, subject to the following conditions:
-;
-; The above copyright notice and this permission notice shall be included in
-; all copies or substantial portions of the Software.
-;
-; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-; THE SOFTWARE.
-
-(clojure.core/in-ns 'vimclojure.util)
-
-(require '[clojure.contrib.pprint :as pprint])
-
-(defoptional pretty-print
- [form]
- (pprint/pprint form))
-
-(defoptional pretty-print-code
- [form]
- (pprint/with-pprint-dispatch pprint/*code-dispatch*
- (pprint/pprint form)))
View
37 server/src/main/clojure/vimclojure/util.clj
@@ -20,7 +20,10 @@
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.
-(ns vimclojure.util)
+(ns vimclojure.util
+ (:require
+ [clojure.pprint :as pprint]
+ [clojure.stacktrace :as stacktrace]))
; Common helpers
(defn str-cut
@@ -392,52 +395,38 @@
"Print the given form in a pretty way. If Tom Faulhaber's pretty printer is
not installed simply defaults prn."
[form]
- (prn form))
+ (pprint/pprint form))
(defn pretty-print-code
"Print the given form in a pretty way. If Tom Faulhaber's pretty printer is
not installed simply defaults prn. Uses the *code-dispatch* formatting."
[form]
- (prn form))
+ (pprint/with-pprint-dispatch pprint/code-dispatch
+ (pprint/pprint form)))
(defn pretty-print-stacktrace
"Print the stacktrace of the given Throwable. Tries clj-stacktrace,
clojure.stacktrace and clojure.contrib.stacktrace in that order. Otherwise
defaults to simple printing."
[e]
- (.printStackTrace e *out*))
+ (stacktrace/print-stack-trace e))
(defn pretty-print-causetrace
"Print the causetrace of the given Throwable. Tries clj-stacktrace,
clojure.stacktrace and clojure.contrib.stacktrace in that order. Otherwise
defaults to simple printing."
[e]
- (pretty-print-stacktrace e))
+ (stacktrace/print-cause-trace e))
; Load optional libraries
(defmacro defoptional
- [sym args & body]
- `(let [docstring# (:doc (meta (var ~sym)))]
- (defn ~sym ~args ~@body)
- (alter-meta! (var ~sym) assoc :doc docstring#)))
-
-(try
- (load "optional/prettyprint")
- (catch Exception exc
- (when-not (re-find #"Could not locate clojure/contrib/pprint__init.class or clojure/contrib/pprint.clj on classpath" (str exc))
- (throw exc))))
-
-(def stacktrace-printer nil)
+ [sym args & body]
+ `(let [docstring# (:doc (meta (var ~sym)))]
+ (defn ~sym ~args ~@body)
+ (alter-meta! (var ~sym) assoc :doc docstring#)))
(try
(load "optional/clj_stacktrace")
(catch Exception exc
(when-not (re-find #"Could not locate clj_stacktrace/repl__init.class or clj_stacktrace/repl.clj on classpath" (str exc))
(throw exc))))
-
-(when-not stacktrace-printer
- (try
- (load "optional/core_stacktrace")
- (catch Exception exc
- (when-not (re-find #"Could not locate clojure/stacktrace__init.class or clojure/stacktrace.clj on classpath" (str exc))
- (throw exc)))))
Please sign in to comment.
Something went wrong with that request. Please try again.