Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Dec 4, 2009
2 parents 4d3c5e9 + 76e7c43 commit c6b6f8b
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 329 deletions.
37 changes: 22 additions & 15 deletions src/clj/clojure/core.clj
Expand Up @@ -6,7 +6,9 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.

(ns clojure.core)
(ns #^{:doc "The core Clojure language."
:author "Rich Hickey"}
clojure.core)

(def unquote)
(def unquote-splicing)
Expand Down Expand Up @@ -2951,7 +2953,7 @@
conds (when (and (next body) (map? (first body)))
(first body))
body (if conds (next body) body)
conds (or conds ^params)
conds (or conds (meta params))
pre (:pre conds)
post (:post conds)
body (if post
Expand Down Expand Up @@ -3180,7 +3182,7 @@
"test [v] finds fn at key :test in var metadata and calls it,
presuming failure will throw exception"
[v]
(let [f (:test ^v)]
(let [f (:test (meta v))]
(if f
(do (f) :ok)
:no-test)))
Expand Down Expand Up @@ -3262,11 +3264,11 @@

(defn print-doc [v]
(println "-------------------------")
(println (str (ns-name (:ns ^v)) "/" (:name ^v)))
(prn (:arglists ^v))
(when (:macro ^v)
(println (str (ns-name (:ns (meta v))) "/" (:name (meta v))))
(prn (:arglists (meta v)))
(when (:macro (meta v))
(println "Macro"))
(println " " (:doc ^v)))
(println " " (:doc (meta v))))

(defn find-doc
"Prints documentation for any var whose documentation or name
Expand All @@ -3275,9 +3277,9 @@
(let [re (re-pattern re-string-or-pattern)]
(doseq [ns (all-ns)
v (sort-by (comp :name meta) (vals (ns-interns ns)))
:when (and (:doc ^v)
(or (re-find (re-matcher re (:doc ^v)))
(re-find (re-matcher re (str (:name ^v))))))]
:when (and (:doc (meta v))
(or (re-find (re-matcher re (:doc (meta v))))
(re-find (re-matcher re (str (:name (meta v)))))))]
(print-doc v))))

(defn special-form-anchor
Expand Down Expand Up @@ -3305,7 +3307,7 @@
[nspace]
(println "-------------------------")
(println (str (ns-name nspace)))
(println " " (:doc ^nspace)))
(println " " (:doc (meta nspace))))

(defmacro doc
"Prints documentation for a var or special form given its name"
Expand Down Expand Up @@ -3492,8 +3494,13 @@
[f] (lazy-seq (cons (f) (repeatedly f))))

(defn add-classpath
"Adds the url (String or URL object) to the classpath per URLClassLoader.addURL"
[url] (. clojure.lang.RT addURL url))
"DEPRECATED
Adds the url (String or URL object) to the classpath per
URLClassLoader.addURL"
[url]
(println "WARNING: add-classpath is deprecated")
(clojure.lang.RT/addURL url))



Expand Down Expand Up @@ -4312,11 +4319,11 @@
metadata from the name symbol. Returns the var."
([ns #^clojure.lang.Symbol name]
(let [v (clojure.lang.Var/intern (the-ns ns) name)]
(when ^name (.setMeta v ^name))
(when (meta name) (.setMeta v (meta name)))
v))
([ns name val]
(let [v (clojure.lang.Var/intern (the-ns ns) name val)]
(when ^name (.setMeta v ^name))
(when (meta name) (.setMeta v (meta name)))
v)))

(defmacro while
Expand Down
2 changes: 1 addition & 1 deletion src/clj/clojure/genclass.clj
Expand Up @@ -381,7 +381,7 @@
mm (mapcat #(.getMethods #^Class %) interfaces))
;extra methods
(doseq [[mname pclasses rclass :as msig] methods]
(emit-forwarding-method (str mname) pclasses rclass (:static ^msig)
(emit-forwarding-method (str mname) pclasses rclass (:static (meta msig))
emit-unsupported))
;expose specified overridden superclass methods
(doseq [[local-mname #^java.lang.reflect.Method m] (reduce (fn [ms [[name _ _] m]]
Expand Down
4 changes: 3 additions & 1 deletion src/clj/clojure/inspector.clj
Expand Up @@ -6,7 +6,9 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.

(ns clojure.inspector
(ns #^{:doc "Graphical object inspector for Clojure data structures."
:author "Rich Hickey"}
clojure.inspector
(:import
(java.awt BorderLayout)
(java.awt.event ActionEvent ActionListener)
Expand Down
4 changes: 3 additions & 1 deletion src/clj/clojure/main.clj
Expand Up @@ -8,7 +8,9 @@

;; Originally contributed by Stephen C. Gilardi

(ns clojure.main
(ns #^{:doc "Top-level main function for Clojure REPL and scripts."
:author "Stephen C. Gilardi and Rich Hickey"}
clojure.main
(:refer-clojure :exclude [with-bindings])
(:import (clojure.lang Compiler Compiler$CompilerException
LineNumberingPushbackReader RT)))
Expand Down
4 changes: 3 additions & 1 deletion src/clj/clojure/parallel.clj
Expand Up @@ -6,7 +6,9 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.

(ns clojure.parallel)
(ns #^{:doc "DEPRECATED Wrapper of the ForkJoin library (JSR-166)."
:author "Rich Hickey"}
clojure.parallel)
(alias 'parallel 'clojure.parallel)

(comment "
Expand Down
4 changes: 3 additions & 1 deletion src/clj/clojure/set.clj
Expand Up @@ -6,7 +6,9 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.

(ns clojure.set)
(ns #^{:doc "Set operations such as union/intersection."
:author "Rich Hickey"}
clojure.set)

(defn- bubble-max-key [k coll]
"Move a maximal element of coll according to fn k (which returns a number)
Expand Down
5 changes: 2 additions & 3 deletions src/clj/clojure/stacktrace.clj
Expand Up @@ -11,9 +11,8 @@
;; by Stuart Sierra
;; January 6, 2009

(ns
#^{:author "Stuart Sierra",
:doc "Print Clojure-centric stack traces"}
(ns #^{:doc "Print stack traces oriented towards Clojure, not Java."
:author "Stuart Sierra"}
clojure.stacktrace)

(defn root-cause
Expand Down
4 changes: 2 additions & 2 deletions src/clj/clojure/template.clj
Expand Up @@ -22,8 +22,8 @@
;; December 15, 2008: first version


(ns #^{:author "Stuart Sierra"
:doc "Macros that expand to repeated copies of a template expression."}
(ns #^{:doc "Macros that expand to repeated copies of a template expression."
:author "Stuart Sierra"}
clojure.template
(:require [clojure.walk :as walk]))

Expand Down

0 comments on commit c6b6f8b

Please sign in to comment.