Public Vars

Back

remove-ns (clj)

(source)

function

(remove-ns sym)
Removes the namespace named by the symbol. Use with caution. Cannot be used to remove the clojure namespace.

Examples

typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

cc/find-ns [t/Sym :-> (t/Nilable t/Namespace)]
cc/create-ns [t/Sym :-> t/Namespace]
#?@(:cljs [] :default [
cc/remove-ns [t/Sym :-> t/Namespace]
cc/ns-map [(t/U t/Sym t/Namespace) :-> t/Sym]
cc/ns-aliases [(t/U t/Sym t/Namespace) :-> (t/Map t/Sym t/Namespace)]
cc/the-ns [(t/U t/Sym t/Namespace) :-> t/Namespace]
cc/in-ns [t/Sym :-> nil]
cc/import [t/Any :* :-> nil]
])
cc/namespace [(t/U t/Sym t/Keyword) :-> (t/Nilable t/Str)]
cc/ns-name [(t/U t/Sym t/Namespace) :-> t/Sym]
cc/name [(t/U t/Str t/Named) :-> t/Str]
cc/identity (t/All [x] [x :-> x
                        :filters {:then (! (t/U nil false) 0)
                                  :else (is (t/U nil false) 0)}
                        :object {:id 0}])
cc/gensym [(t/? (t/U t/Sym t/Str)) :-> t/Sym]
#?@(:cljs [] :default [
cc/intern [(t/U t/Sym t/Namespace) t/Sym (t/? t/Any) :-> t/AnyVar]
])
typedclojure/typedclojure
(ns ^:typed/skip-from-repo-root clojure.core.typed.test.load-test
  (:require [clojure.core.typed.load :as load]
            [clojure.test :refer :all]))

;; ensures evaluation occurs
(deftest evaluation-test
  (is (try (some-> (find-ns 'clojure.core.typed.test.typed-load.eval)
                   ns-name
                   remove-ns)
           (load/typed-load1 "clojure/core/typed/test/typed_load/eval")
           nil
           (catch clojure.lang.ExceptionInfo e
             (-> e ex-data :blame :file #{"clojure/core/typed/test/typed_load/eval.clj"})))))
typedclojure/typedclojure
(ns clojure.core.typed.test.cljc
  (:require [clojure.test :refer :all]
            [clojure.core.typed :as t]
            [clojure.core.typed.load :as load]))

(deftest check-ns-should-load-cljc-files
  (remove-ns 'clojure.core.typed.test.dummy-cljc)
  (is (t/check-ns 'clojure.core.typed.test.dummy-cljc)))

(deftest check-ns-should-load-clj-files-before-cljc
  (remove-ns 'clojure.core.typed.test.duplicated)
  (is (t/check-ns 'clojure.core.typed.test.duplicated)))

(deftest allow-reader-conditional-in-ns-form
  (remove-ns 'clojure.core.typed.test.reader-cond)
  (is (t/check-ns 'clojure.core.typed.test.reader-cond)))