Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
marking deprecations in ns-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Bedra and Stuart Halloway committed Jul 23, 2010
1 parent a762fda commit df1b195
Showing 1 changed file with 26 additions and 32 deletions.
58 changes: 26 additions & 32 deletions src/main/clojure/clojure/contrib/ns_utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,35 @@
;; using this software in any fashion, you are agreeing to be bound by the
;; terms of this license. You must not remove this notice, or any other,
;; from this software.
;;
;; ns-utils
;;
;; Namespace Utilities
;;
;; 'get-ns' returns the namespace named by a symbol or throws
;; if the namespace does not exist
;;
;; 'ns-vars' returns a sorted seq of symbols naming public vars
;; in a namespace
;;
;; 'print-dir' prints a sorted directory of public vars in a
;; namespace
;;
;; 'print-docs' prints documentation for the public vars in a
;; namespace
;;
;; 'immigrate' Create a public var in this namespace for each
;; public var in the namespaces named by ns-names.
;; From James Reeves
;; Convenience
;;
;; 'vars' returns a sorted seq of symbols naming public vars
;; in a namespace (macro)
;;
;; 'dir' prints a sorted directory of public vars in a
;; namespace (macro)
;;
;; 'docs' prints documentation for the public vars in a
;; namespace (macro)
;;

;; scgilardi (gmail)
;; 23 April 2008

;; DEPRECATED in 1.2: dir and print-dir. Use dir and dir-fn in
;; clojure.repl.

(ns
^{:author "Stephen C. Gilardi",
:doc "Namespace utilities"}
:doc "Namespace utilities
get-ns returns the namespace named by a symbol or throws
if the namespace does not exist
ns-vars returns a sorted seq of symbols naming public vars
in a namespace
print-docs prints documentation for the public vars in a
namespace
immigrate Create a public var in this namespace for each
public var in the namespaces named by ns-names.
From James Reeves
vars returns a sorted seq of symbols naming public vars
in a namespace (macro)
docs prints documentation for the public vars in a
namespace (macro)"}
clojure.contrib.ns-utils
(:use clojure.contrib.except))

Expand All @@ -63,6 +55,7 @@

(defn print-dir
"Prints a sorted directory of public vars in a namespace"
{:deprecated "1.2"}
[ns]
(doseq [item (ns-vars ns)]
(println item)))
Expand All @@ -83,6 +76,7 @@

(defmacro dir
"Prints a sorted directory of public vars in a namespace"
{:deprecated "1.2"}
[nsname]
`(print-dir (get-ns '~nsname)))

Expand Down

0 comments on commit df1b195

Please sign in to comment.