Public Vars

Back

print-dup (clj)

(source)

multimethod

Examples

clojure
(deftest division
  (is (= clojure.core// /))
  (binding [*ns* *ns*]
    (eval '(do (ns foo
                 (:require [clojure.core :as bar])
                 (:use [clojure.test]))
               (is (= clojure.core// bar//))))))


(defn roundtrip
  "Print an object and read it back. Returns rather than throws
   any exceptions."
  [o]
  (binding [*print-length* nil
            *print-dup* nil
            *print-level* nil]
    (try
     (-> o pr-str read-string)
     (catch Throwable t t))))

(defn roundtrip-dup
  "Print an object with print-dup and read it back.
   Returns rather than throws any exceptions."
  [o]
  (binding [*print-length* nil
            *print-dup* true
            *print-level* nil]
    (try
     (-> o pr-str read-string)
     (catch Throwable t t))))
arohner/spectrum
(ns spectrum.core-specs
  (:require [clojure.core :as core]
            [clojure.spec.alpha :as s]
            [spectrum.core :as st]
            [spectrum.types :as t]
            [spectrum.util :refer [def-instance-predicate]]))

(st/var-spec #'clojure.core/*ns* #'namespace?)
(st/var-spec #'clojure.core/*file* #'string?)
(st/var-spec #'clojure.core/*print-dup* #'boolean?)
(st/var-spec #'clojure.core/*unchecked-math* #'boolean?)
(st/var-spec #'clojure.core/*agent* (t/or-t [(t/class-t clojure.lang.Agent) (t/value-t nil)]))
(st/var-spec #'clojure.core/*warn-on-reflection* #'boolean?)
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))))

#?@(:cljs [] :default [
cc/*file* t/Str
])
cc/*command-line-args* (t/NilableNonEmptyASeq t/Str)
#?@(:cljs [
cc/*unchecked-if* t/Bool
cc/*unchecked-arrays* t/Bool
cc/*warn-on-infer* t/Bool
cc/enable-console-print! [:-> t/Any]
] :default [
cc/*warn-on-reflection* t/Bool
cc/*compile-path* t/Str
cc/*compile-files* t/Bool
cc/*unchecked-math* t/Bool
cc/*compiler-options* (t/Map t/Any t/Any)
cc/*in* java.io.Reader
cc/*out* java.io.Writer ;; FIXME cljs
cc/*err* java.io.Writer
cc/*repl* t/Any
])
cc/*flush-on-newline* t/Bool
cc/*print-meta* t/Bool
cc/*print-dup* t/Bool
cc/*print-readably* t/Bool
#?@(:cljs [] :default [
cc/*read-eval* (t/U ':unknown t/Bool)
])