diff options
Diffstat (limited to 'src/clj')
-rw-r--r-- | src/clj/clojure/core.clj | 18 | ||||
-rw-r--r-- | src/clj/clojure/core_print.clj | 4 | ||||
-rw-r--r-- | src/clj/clojure/java/browse.clj | 2 | ||||
-rw-r--r-- | src/clj/clojure/java/javadoc.clj | 10 | ||||
-rw-r--r-- | src/clj/clojure/java/shell.clj | 4 | ||||
-rw-r--r-- | src/clj/clojure/pprint/cl_format.clj | 2 | ||||
-rw-r--r-- | src/clj/clojure/pprint/column_writer.clj | 2 | ||||
-rw-r--r-- | src/clj/clojure/pprint/dispatch.clj | 4 | ||||
-rw-r--r-- | src/clj/clojure/pprint/pprint_base.clj | 24 | ||||
-rw-r--r-- | src/clj/clojure/test.clj | 14 | ||||
-rw-r--r-- | src/clj/clojure/test/junit.clj | 4 | ||||
-rw-r--r-- | src/clj/clojure/xml.clj | 8 |
12 files changed, 48 insertions, 48 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 2f5504cc..f2993af8 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -3140,7 +3140,7 @@ (number? x) (BigDecimal/valueOf (long x)) :else (BigDecimal. x))) -(def ^{:private true} print-initialized false) +(def ^:dynamic ^{:private true} print-initialized false) (defmulti print-method (fn [x writer] (type x))) (defmulti print-dup (fn [x writer] (class x))) @@ -5095,17 +5095,17 @@ ;;;;;;;;;;; require/use/load, contributed by Stephen C. Gilardi ;;;;;;;;;;;;;;;;;; -(defonce +(defonce ^:dynamic ^{:private true :doc "A ref to a sorted set of symbols representing loaded libs"} *loaded-libs* (ref (sorted-set))) -(defonce +(defonce ^:dynamic ^{:private true :doc "the set of paths currently being loaded by this thread"} *pending-paths* #{}) -(defonce +(defonce ^:dynamic ^{:private true :doc "True while a verbose load is pending"} *loading-verbosely* false) @@ -5465,22 +5465,22 @@ :static true} [coll] (instance? clojure.lang.Reversible coll)) -(def +(def ^:dynamic ^{:doc "bound in a repl thread to the most recent value printed" :added "1.0"} *1) -(def +(def ^:dynamic ^{:doc "bound in a repl thread to the second most recent value printed" :added "1.0"} *2) -(def +(def ^:dynamic ^{:doc "bound in a repl thread to the third most recent value printed" :added "1.0"} *3) -(def +(def ^:dynamic ^{:doc "bound in a repl thread to the most recent exception caught by the repl" :added "1.0"} *e) @@ -5941,7 +5941,7 @@ :minor (Integer/valueOf ^String (prop "minor")) :incremental (Integer/valueOf ^String (prop "incremental")) :qualifier (prop "qualifier")}] - (def *clojure-version* + (def ^:dynamic *clojure-version* (if (not (= (prop "interim") "false")) (clojure.lang.RT/assoc clojure-version :interim true) clojure-version))) diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj index a8a198fd..dad509a7 100644 --- a/src/clj/clojure/core_print.clj +++ b/src/clj/clojure/core_print.clj @@ -12,7 +12,7 @@ (import '(java.io Writer)) -(def +(def ^:dynamic ^{:doc "*print-length* controls how many items of each collection the printer will print. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum @@ -23,7 +23,7 @@ :added "1.0"} *print-length* nil) -(def +(def ^:dynamic ^{:doc "*print-level* controls how many levels deep the printer will print nested objects. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum diff --git a/src/clj/clojure/java/browse.clj b/src/clj/clojure/java/browse.clj index bc71553a..1acda374 100644 --- a/src/clj/clojure/java/browse.clj +++ b/src/clj/clojure/java/browse.clj @@ -17,7 +17,7 @@ (-> "os.name" System/getProperty .toLowerCase (.startsWith "mac os x"))) -(def *open-url-script* (when (macosx?) "/usr/bin/open")) +(def ^:dynamic *open-url-script* (when (macosx?) "/usr/bin/open")) (defn- open-url-in-browser "Opens url (a string) in the default system web browser. May not diff --git a/src/clj/clojure/java/javadoc.clj b/src/clj/clojure/java/javadoc.clj index cefdff1f..7a68bc0a 100644 --- a/src/clj/clojure/java/javadoc.clj +++ b/src/clj/clojure/java/javadoc.clj @@ -13,17 +13,17 @@ (:import (java.io File))) -(def *feeling-lucky-url* "http://www.google.com/search?btnI=I%27m%20Feeling%20Lucky&q=allinurl:") -(def *feeling-lucky* true) +(def ^:dynamic *feeling-lucky-url* "http://www.google.com/search?btnI=I%27m%20Feeling%20Lucky&q=allinurl:") +(def ^:dynamic *feeling-lucky* true) -(def *local-javadocs* (ref (list))) +(def ^:dynamic *local-javadocs* (ref (list))) -(def *core-java-api* +(def ^:dynamic *core-java-api* (if (= "1.5" (System/getProperty "java.specification.version")) "http://java.sun.com/j2se/1.5.0/docs/api/" "http://java.sun.com/javase/6/docs/api/")) -(def *remote-javadocs* +(def ^:dynamic *remote-javadocs* (ref (sorted-map "java." *core-java-api* "javax." *core-java-api* diff --git a/src/clj/clojure/java/shell.clj b/src/clj/clojure/java/shell.clj index 004629df..5388e7a2 100644 --- a/src/clj/clojure/java/shell.clj +++ b/src/clj/clojure/java/shell.clj @@ -15,8 +15,8 @@ collecting its stdout"} (:import (java.io OutputStreamWriter ByteArrayOutputStream StringWriter) (java.nio.charset Charset))) -(def *sh-dir* nil) -(def *sh-env* nil) +(def ^:dynamic *sh-dir* nil) +(def ^:dynamic *sh-env* nil) (defmacro with-sh-dir "Sets the directory for use with sh, see sh for details." diff --git a/src/clj/clojure/pprint/cl_format.clj b/src/clj/clojure/pprint/cl_format.clj index 5c934f31..42594f07 100644 --- a/src/clj/clojure/pprint/cl_format.clj +++ b/src/clj/clojure/pprint/cl_format.clj @@ -63,7 +63,7 @@ http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm navigator (init-navigator args)] (execute-format writer compiled-format navigator))) -(def ^{:private true} *format-str* nil) +(def ^:dynamic ^{:private true} *format-str* nil) (defn- format-error [message offset] (let [full-message (str message \newline *format-str* \newline diff --git a/src/clj/clojure/pprint/column_writer.clj b/src/clj/clojure/pprint/column_writer.clj index f02ac0dc..0449d439 100644 --- a/src/clj/clojure/pprint/column_writer.clj +++ b/src/clj/clojure/pprint/column_writer.clj @@ -20,7 +20,7 @@ (import [clojure.lang IDeref] [java.io Writer]) -(def ^{:private true} *default-page-width* 72) +(def ^:dynamic ^{:private true} *default-page-width* 72) (defn- get-field [^Writer this sym] (sym @@this)) diff --git a/src/clj/clojure/pprint/dispatch.clj b/src/clj/clojure/pprint/dispatch.clj index 77e145fa..99a131c8 100644 --- a/src/clj/clojure/pprint/dispatch.clj +++ b/src/clj/clojure/pprint/dispatch.clj @@ -289,7 +289,7 @@ (pprint-simple-code-list alis))) ;;; The map of symbols that are defined in an enclosing #() anonymous function -(def ^{:private true} *symbol-map* {}) +(def ^:dynamic ^{:private true} *symbol-map* {}) (defn- pprint-anon-func [alis] (let [args (second alis) @@ -342,7 +342,7 @@ %)) amap)))) -(def ^{:private true} *code-table* +(def ^:dynamic ^{:private true} *code-table* (two-forms (add-core-ns {'def pprint-hold-first, 'defonce pprint-hold-first, diff --git a/src/clj/clojure/pprint/pprint_base.clj b/src/clj/clojure/pprint/pprint_base.clj index 9ff74e85..9c82fa69 100644 --- a/src/clj/clojure/pprint/pprint_base.clj +++ b/src/clj/clojure/pprint/pprint_base.clj @@ -27,24 +27,24 @@ ;;; constructs -(def +(def ^:dynamic ^{:doc "Bind to true if you want write to use pretty printing", :added "1.2"} *print-pretty* true) -(defonce ; If folks have added stuff here, don't overwrite +(defonce ^:dynamic ; If folks have added stuff here, don't overwrite ^{:doc "The pretty print dispatch function. Use with-pprint-dispatch or set-pprint-dispatch to modify.", :added "1.2"} *print-pprint-dispatch* nil) -(def +(def ^:dynamic ^{:doc "Pretty printing will try to avoid anything going beyond this column. Set it to nil to have pprint let the line be arbitrarily long. This will ignore all non-mandatory newlines.", :added "1.2"} *print-right-margin* 72) -(def +(def ^:dynamic ^{:doc "The column at which to enter miser style. Depending on the dispatch table, miser style add newlines in more places to try to keep lines short allowing for further levels of nesting.", @@ -52,24 +52,24 @@ levels of nesting.", *print-miser-width* 40) ;;; TODO implement output limiting -(def +(def ^:dynamic ^{:private true, :doc "Maximum number of lines to print in a pretty print instance (N.B. This is not yet used)"} *print-lines* nil) ;;; TODO: implement circle and shared -(def +(def ^:dynamic ^{:private true, :doc "Mark circular structures (N.B. This is not yet used)"} *print-circle* nil) ;;; TODO: should we just use *print-dup* here? -(def +(def ^:dynamic ^{:private true, :doc "Mark repeated structures rather than repeat them (N.B. This is not yet used)"} *print-shared* nil) -(def +(def ^:dynamic ^{:doc "Don't print namespaces with symbols. This is particularly useful when pretty printing the results of macro expansions" :added "1.2"} @@ -77,14 +77,14 @@ pretty printing the results of macro expansions" ;;; TODO: support print-base and print-radix in cl-format ;;; TODO: support print-base and print-radix in rationals -(def +(def ^:dynamic ^{:doc "Print a radix specifier in front of integers and rationals. If *print-base* is 2, 8, or 16, then the radix specifier used is #b, #o, or #x, respectively. Otherwise the radix specifier is in the form #XXr where XX is the decimal value of *print-base* " :added "1.2"} *print-radix* nil) -(def +(def ^:dynamic ^{:doc "The base to use for printing integers and rationals." :added "1.2"} *print-base* 10) @@ -96,9 +96,9 @@ radix specifier is in the form #XXr where XX is the decimal value of *print-base ;; structure ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(def ^{ :private true } *current-level* 0) +(def ^:dynamic ^{ :private true } *current-level* 0) -(def ^{ :private true } *current-length* nil) +(def ^:dynamic ^{ :private true } *current-length* nil) ;; TODO: add variables for length, lines. diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj index 62dba13b..755ec0b4 100644 --- a/src/clj/clojure/test.clj +++ b/src/clj/clojure/test.clj @@ -236,14 +236,14 @@ ;;; USER-MODIFIABLE GLOBALS -(defonce +(defonce ^:dynamic ^{:doc "True by default. If set to false, no test functions will be created by deftest, set-test, or with-test. Use this to omit tests when compiling or loading production code." :added "1.1"} *load-tests* true) -(def +(def ^:dynamic ^{:doc "The maximum depth of stack traces to print when an Exception is thrown during a test. Defaults to nil, which means print the complete stack trace." @@ -253,16 +253,16 @@ ;;; GLOBALS USED BY THE REPORTING FUNCTIONS -(def *report-counters* nil) ; bound to a ref of a map in test-ns +(def ^:dynamic *report-counters* nil) ; bound to a ref of a map in test-ns -(def *initial-report-counters* ; used to initialize *report-counters* +(def ^:dynamic *initial-report-counters* ; used to initialize *report-counters* {:test 0, :pass 0, :fail 0, :error 0}) -(def *testing-vars* (list)) ; bound to hierarchy of vars being tested +(def ^:dynamic *testing-vars* (list)) ; bound to hierarchy of vars being tested -(def *testing-contexts* (list)) ; bound to hierarchy of "testing" strings +(def ^:dynamic *testing-contexts* (list)) ; bound to hierarchy of "testing" strings -(def *test-out* *out*) ; PrintWriter for test reporting output +(def ^:dynamic *test-out* *out*) ; PrintWriter for test reporting output (defmacro with-test-out "Runs body with *out* bound to the value of *test-out*." diff --git a/src/clj/clojure/test/junit.clj b/src/clj/clojure/test/junit.clj index 7e696e3b..026b209d 100644 --- a/src/clj/clojure/test/junit.clj +++ b/src/clj/clojure/test/junit.clj @@ -45,8 +45,8 @@ (defn- escape-xml [text] (apply str (map #(escape-xml-map % %) text))) -(def *var-context*) -(def *depth*) +(def ^:dynamic *var-context*) +(def ^:dynamic *depth*) (defn indent [] diff --git a/src/clj/clojure/xml.clj b/src/clj/clojure/xml.clj index 78f053fb..4e4220f2 100644 --- a/src/clj/clojure/xml.clj +++ b/src/clj/clojure/xml.clj @@ -12,10 +12,10 @@ (:import (org.xml.sax ContentHandler Attributes SAXException) (javax.xml.parsers SAXParser SAXParserFactory))) -(def *stack*) -(def *current*) -(def *state*) ; :element :chars :between -(def *sb*) +(def ^:dynamic *stack*) +(def ^:dynamic *current*) +(def ^:dynamic *state*) ; :element :chars :between +(def ^:dynamic *sb*) (defstruct element :tag :attrs :content) |