Public Vars

Back

alias (clj)

(source)

function

(alias alias namespace-sym)
Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly.

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//))))))

(deftest namespaced-map-errors
  (are [err msg form] (thrown-with-msg? err msg (read-string form))
                      Exception #"Invalid token" "#:::"
                      Exception #"Namespaced map literal must contain an even number of forms" "#:s{1}"
                      Exception #"Namespaced map must specify a valid namespace" "#:s/t{1 2}"
                      Exception #"Unknown auto-resolved namespace alias" "#::BOGUS{1 2}"
                      Exception #"Namespaced map must specify a namespace" "#: s{:a 1}"
                      Exception #"Duplicate key: :user/a" "#::{:a 1 :a 2}"
                      Exception #"Duplicate key: user/a" "#::{a 1 a 2}"))
hraberg/deuce
(ns deuce.emacs.eval
  (:use [deuce.emacs-lisp :only (defun defvar)])
  (:require [clojure.core :as c]
            [deuce.emacs.alloc :as alloc]
            [deuce.emacs.data :as data]
            [deuce.emacs-lisp.cons :as cons]
            [deuce.emacs-lisp :as el])
  (:import [clojure.lang Var])
  (:refer-clojure :exclude [apply eval macroexpand]))

  This function returns t if (i) the first character of its
  documentation is `*', or (ii) it is customizable (its property list
  contains a non-nil value of `standard-value' or `custom-autoload'), or
  (iii) it is an alias for a user variable.

(defun autoload (function file &optional docstring interactive type)
  "Define FUNCTION to autoload from FILE.
  FUNCTION is a symbol; FILE is a file name string to pass to `load'.
  Third arg DOCSTRING is documentation for the function.
  Fourth arg INTERACTIVE if non-nil says function can be called interactively.
  Fifth arg TYPE indicates the type of the object:
     nil or omitted says FUNCTION is a function,
     `keymap' says FUNCTION is really a keymap, and
     `macro' or t says FUNCTION is really a macro.
  Third through fifth args give info about the real definition.
  They default to nil.
  If FUNCTION is already defined other than as an autoload,
  this does nothing and returns nil."
  (when (or (not (el/fun function)) (-> (el/fun function) meta :autoload))
    (let [macro? (= 'macro type)
          autoload-symbol (fn autoload-symbol [function]
                            (let [f (el/fun function)]
                              (when (-> f meta :autoload)
                                (ns-unmap 'deuce.emacs (el/sym function))
                                ((el/fun 'load) (-> f meta :file) nil true))))
          definition  (if macro?
                        (fn autoload-macro [&form &env & args] ;; Note implicit macro args, see defalias
                          (do
                            (autoload-symbol function)
                            `(el/progn (~(el/sym function) ~@args))))
                        (fn autoload [& args]
                          (autoload-symbol function)
                          (c/apply (el/fun function) args)))] ;; el->clj?
      (ns-unmap 'deuce.emacs function)
      (el/defvar-helper* 'deuce.emacs function definition docstring)
      (alter-meta! (el/fun function) merge {:autoload true :file file} (when interactive {:interactive nil}))
      (when macro? (.setMacro ^Var (el/fun function))))
    function))

(defun defvaralias (new-alias base-variable &optional docstring)
  "Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
  Aliased variables always have the same value; setting one sets the other.
  Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS.  If it is
  omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE,
  or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
  itself an alias.  If NEW-ALIAS is bound, and BASE-VARIABLE is not,
  then the value of BASE-VARIABLE is set to that of NEW-ALIAS.
  The return value is BASE-VARIABLE."
  (if-let [base (el/global base-variable)]
    (el/defvar-helper* 'deuce.emacs-lisp.globals new-alias
      @base (or docstring (-> base meta :doc)))
    (when-let [new (el/global new-alias)]
      (el/defvar-helper* 'deuce.emacs-lisp.globals base-variable
        @new (or docstring (-> new meta :doc)))))
  base-variable)
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))))

#?(:clj (do
(t/defalias IOFactoryOpts (t/HMap :optional {:append t/Any, :encoding (t/Nilable t/Str)}))
(t/ann-protocol clojure.java.io/IOFactory
                make-reader
                [clojure.java.io/IOFactory IOFactoryOpts :-> java.io.BufferedReader]

;; ==========================================
;; Type aliases

(t/defalias
  ^{:doc "A type that returns true for clojure.core/integer?"
    :forms '[AnyInteger]}
  t/AnyInteger
  #?(:clj (t/U Integer
               Long
               clojure.lang.BigInt
               BigInteger
               Short
               Byte)
     :cljs t/CLJSInteger))

(t/defalias
  ^{:doc "A type that returns true for clojure.core/integer?"
    :forms '[Int]}
  t/Int
  t/AnyInteger)

(t/defalias
  ^{:doc "A type that returns true for clojure.core/number?"
    :forms '[Num]}
  t/Num
  #?(:clj Number
     :cljs t/JSnumber))

(t/defalias
  ^{:doc "A keyword"
    :forms '[Keyword]}
  t/Keyword
  #?(:clj clojure.lang.Keyword
     :cljs cljs.core/Keyword))

(t/defalias
  ^{:doc "A keyword"
    :forms '[Kw]}
  t/Kw
  t/Keyword)

(t/defalias
  ^{:doc "A symbol"
    :forms '[Symbol]}
  t/Symbol
  #?(:clj clojure.lang.Symbol
     :cljs cljs.core/Symbol))

(t/defalias
  ^{:doc "A symbol"
    :forms '[Sym]}
  t/Sym
  t/Symbol)

(t/defalias
  t/Ident
  (t/U t/Sym t/Kw))

(t/defalias
  ^{:doc "A string"
    :forms '[Str]}
  t/Str
  #?(:clj java.lang.String
     :cljs t/JSstring))

(t/defalias
  t/Named
  #?(:clj clojure.lang.Named
     :cljs cljs.core/INamed))

(t/defalias
  t/Indexed
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.Indexed x)
            :cljs (cljs.core/IIndexed x))))

(t/defalias
  ^{:doc "A boolean"
    :forms '[Bool]}
  t/Bool
  #?(:clj java.lang.Boolean
     :cljs t/JSboolean))

(t/defalias
  ^{:doc "A namespace"
    :forms '[Namespace]}
  t/Namespace
  #?(:clj clojure.lang.Namespace
     ;; nilable?
     :cljs cljs.core/Namespace))

(t/defalias
  t/UUID
  #?(:clj java.util.UUID
     :cljs cljs.core/UUID))

(t/defalias
  ^{:doc "Supertype of all atoms."
    :forms '[AnyAtom]}
  t/AnyAtom
  (t/Instance
    #?(:clj clojure.lang.Atom
       :cljs cljs.core/Atom)))

(t/defalias
  ^{:doc "An atom that can read and write type x."
    :forms '[(Atom x)]}
  t/Atom
  (t/TFn [[x :variance :invariant]]
         (#?(:clj clojure.lang.Atom :cljs cljs.core/Atom) x)))

(t/defalias
  ^{:doc "An atom that can read and write type x.
         
         Deprecated: Please use t/Atom instead."
    :deprecated "1.1.6"
    :superseded-by `t/Atom
    :forms '[(Atom1 x)]}
  t/Atom1
  t/Atom)

(t/defalias
  ^{:doc "Supertype of all volatiles."
    :forms '[AnyVolatile]}
  t/AnyVolatile
  #?(:clj (t/Instance clojure.lang.Volatile)
     :cljs (t/I (cljs.core/IDeref t/Any)
                (t/Instance cljs.core/IVolatile)
                ;;FIXME should just be Volatile
                (t/Instance cljs.core/Volatile))))

(t/defalias
  ^{:doc "A volatile that can read and write type x."
    :forms '[(Volatile x)]}
  t/Volatile
  (t/TFn [[x :variance :invariant]]
         #?(:clj (clojure.lang.Volatile x)
            :cljs (t/I (cljs.core/IDeref x)
                       (cljs.core/IVolatile x)
                       ;;FIXME should just be Volatile
                       (cljs.core/Volatile x)))))

(t/defalias
  ^{:doc "Supertype of all vars."
    :forms '[AnyVar]}
  t/AnyVar
  (t/Instance
    #?(:clj clojure.lang.Var
       :cljs cljs.core/Var)))

(t/defalias
  ^{:doc "A var that can read and write type x."
    :forms '[(Var x)]}
  t/Var
  (t/TFn [[x :variance :invariant]] 
         #?(:clj (clojure.lang.Var x)
            :cljs (cljs.core/Var x))))

(t/defalias
  ^{:doc "An var that can read and write type x."
    :deprecated "1.1.6"
    :superseded-by `t/Var
    :forms '[(Var1 x)]}
  t/Var1
  t/Var)

#?(:clj (t/defalias
          ^{:doc "Supertype of all refs."
            :forms '[AnyRef]}
          t/AnyRef
          (t/Instance clojure.lang.Ref)))

#?(:clj
   (t/defalias
     ^{:doc "A ref that can read and write type x."
       :forms '[(Ref x)]}
     t/Ref
     (t/TFn [[x :variance :invariant]]
            (clojure.lang.Ref x))))

#?(:clj
   (t/defalias
     ^{:doc "A ref that can read and write type x."
       :deprecated "1.1.6"
       :superseded-by `t/Ref
       :forms '[(Ref1 x)]}
     t/Ref1
     t/Ref))

#?(:clj (t/defalias
          ^{:doc "Supertype of all agents."
            :forms '[AnyAgent]}
          t/AnyAgent
          (t/Instance clojure.lang.Agent)))

#?(:clj
   (t/defalias
     ^{:doc "An agent that can read and write type x."
       :forms '[(Agent x)]}
     t/Agent
     (t/TFn [[x :variance :invariant]] 
            (clojure.lang.Agent x))))

#?(:clj
   (t/defalias
     ^{:doc "An agent that can read and write type x.
            
            Deprecated: Please use t/Agent."
       :deprecated "1.1.6"
       :superseded-by `t/Agent
       :forms '[(Agent1 x)]}
     t/Agent1
     t/Agent))

(t/defalias
  ^{:doc "A union of x and nil."
    :forms '[(Option x)]}
  t/Option
  (t/TFn [[x :variance :covariant]] (t/U nil x)))

(t/defalias
  ^{:doc "A union of x and nil."
    :forms '[(Nilable x)]}
  t/Nilable
  t/Option)

(t/defalias
  ^{:doc "The result of re-pattern."
    :forms '[t/Regex]}
  t/Regex
  #?(:clj java.util.regex.Pattern
     :cljs js/Regexp))

(t/defalias
  ^{:doc "The identity function at the type level."
    :forms '[(Id x)]}
  t/Id
  (t/TFn [[x :variance :covariant]] x))

(t/defalias
  ^{:doc "The return type of `seq` on a seqable."
    :forms '[(SeqOn x)]}
  t/SeqOn
  (t/TFn [[x :variance :invariant :< t/AnySeqable]]
         (t/Match x
                  [[Seq :< (t/NilableNonEmptySeq t/Any)]]
                  #?(:clj (clojure.lang.Seqable Seq)
                     :cljs (cljs.core/ISeqable Seq))
                  :-> Seq
                  [[Seq :< (t/NilableNonEmptySeq t/Any)]]
                  (t/Nilable #?(:clj (clojure.lang.Seqable Seq)
                                :cljs (cljs.core/ISeqable Seq)))
                  :-> (t/Nilable Seq))))

(t/defalias
  ^{:doc "A type that returns true for clojure.core/seqable?, with members x."
    :forms '[(Seqable x)]}
  t/Seqable
  (t/TFn [[x :variance :covariant]]
         (t/Nilable
           #?(:clj (clojure.lang.Seqable (t/NilableNonEmptySeq x))
              :cljs (cljs.core/ISeqable (t/NilableNonEmptySeq x))))))

(t/defalias
  ^{:doc "A type that returns true for clojure.core/seqable?."
    :forms '[AnySeqable]}
  t/AnySeqable
  (t/Seqable t/Any))

(t/defalias
  t/Counted
  #?(:clj clojure.lang.Counted
     :cljs cljs.core/ICounted))

(t/defalias
  t/URI
  #?(:clj java.net.URI
     :cljs goog.Uri))

(t/defalias
  ^{:doc "A type that returns true for clojure.core/coll?, with members x."
    :forms '[(Coll x)]}
  t/Coll
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentCollection x)
            :cljs (t/I (t/Seqable x)
                       cljs.core/ICollection
                       ;;cljs.core/ICounted
                       cljs.core/IEmptyableCollection
                       ;;cljs.core/IEquiv
                       ))))

(t/defalias
  ^{:doc "The type of all things with count 0. Use as part of an intersection.
         eg. See EmptySeqable."
    :forms '[EmptyCount]}
  t/EmptyCount
  (t/ExactCount 0))

(t/defalias
  ^{:doc "The type of all things with count greater than 0. Use as part of an intersection.
         eg. See NonEmptySeq"
    :forms '[NonEmptyCount]}
  t/NonEmptyCount
  (t/CountRange 1))

(t/defalias
  ^{:doc "A persistent collection with member type x and count greater than 0."
    :forms '[(NonEmptyColl x)]}
  t/NonEmptyColl
  (t/TFn [[x :variance :covariant]]
         (t/I (t/Coll x)
              t/NonEmptyCount)))

(t/defalias
  ^{:doc "An associative persistent collection supporting associative operations on keys type k and values type v."
    :forms '[(t/Associative k v)]}
  t/Associative
  (t/TFn [[k :variance :covariant]
          [v :variance :covariant]]
         #?(:clj (clojure.lang.Associative k v 
                                           ;;FIXME should be (t/NilableNonEmptySeq t/Any) when IPersistentCollection supports it
                                           t/Any)
            :cljs (t/I (cljs.core/IAssociative k v)
                       ;; emulate clojure.lang.Associative's ancestors
                       (t/Coll t/Any)
                       (cljs.core/ILookup v)))))

(t/defalias
  ^{:doc "A Clojure reversible collection."
    :forms '[(Reversible x)]}
  t/Reversible
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.Reversible x)
            :cljs (cljs.core/IReversible x))))

(t/defalias
  ^{:doc "A persistent vector with member type x."
    :forms '[(Vec x)]}
  t/Vec
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentVector x)
            :cljs (t/I (cljs.core/IVector x)
                       (t/Associative t/Int x)
                       (t/Coll x)
                       (cljs.core/ILookup x)
                       cljs.core/ISequential
                       (cljs.core/IStack x)
                       (t/Reversible x)
                       (t/Indexed x)))))

(t/defalias
  ^{:doc "A persistent vector with member type x and count greater than 0."
    :forms '[(NonEmptyVec x)]}
  t/NonEmptyVec
  (t/TFn [[x :variance :covariant]]
       (t/I (t/Vec x)
            t/NonEmptyCount)))

(t/defalias
  ^{:doc "A persistent vector returned from clojure.core/vector (and others)"
    :forms '[(AVec x)]}
  t/AVec
  (t/TFn [[x :variance :covariant]]
         #?(:clj (t/I ; is this type useful enough? c.l.APV implements a lot more
                      (t/Vec x)
                      (java.lang.Iterable x)
                      (java.util.Collection x)
                      (java.util.List x)
                      clojure.lang.IObj)
            :cljs (t/I (t/Vec x)
                       ; TODO cljs equivalent
                       ))))

(t/defalias
  ^{:doc "A persistent vector returned from clojure.core/vector (and others) and count greater than 0."
    :forms '[(NonEmptyAVec x)]}
  t/NonEmptyAVec
  (t/TFn [[x :variance :covariant]]
       (t/I (t/AVec x)
            t/NonEmptyCount)))

(t/defalias
  t/MapEntry
  (t/TFn [[k :variance :covariant]
          [v :variance :covariant]]
         #?(:clj (clojure.lang.IMapEntry k v)
            :cljs (cc/IMapEntry k v))))

(t/defalias
  t/AMapEntry
  (t/TFn [[k :variance :covariant]
          [v :variance :covariant]]
         #?(:clj (clojure.lang.AMapEntry k v)
            :cljs (cc/IMapEntry k v))))

(t/defalias
  ^{:doc "A persistent map with keys k and vals v."
    :forms '[(Map k v)]}
  t/Map
  (t/TFn [[k :variance :covariant]
          [v :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentMap k v)
            :cljs (t/I cljs.core/ICloneable
                       (cljs.core/IIterable (cc/IMapEntry k v))
                       cljs.core/IWithMeta
                       cljs.core/IMeta
                       cc/ICollection
                       cc/IEmptyableCollection
                       cljs.core/IEquiv
                       cljs.core/IHash
                       (t/Seqable (cc/IMapEntry k v))
                       cc/ICounted
                       (cc/ILookup v)
                       (cc/IAssociative k v)
                       (cc/IFind k v)
                       cljs.core/IMap
                       cljs.core/IKVReduce
                       ;; TODO IFn
                       ;; TODO cljs.core/IEditableCollection
                       ))))

(t/defalias 
  ^{:doc "Values that can be conj'ed to a t/Map, adding keys of type k
         and vals of type v."}
  t/MapConjable
  (t/TFn [[k :variance :covariant]
          [v :variance :covariant]]
         (t/U (t/MapEntry k v)
              '[k v]
              (t/Seqable (t/MapEntry k v)))))

(t/defalias
  ^{:doc "A persistent set with member type x"
    :forms '[(Set x)]}
  t/Set
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentSet x)
            :cljs (t/I cljs.core/ICloneable
                       (cljs.core/IIterable x)
                       cljs.core/IWithMeta
                       cljs.core/IMeta
                       cljs.core/ICollection
                       cljs.core/IEmptyableCollection
                       cljs.core/IEquiv
                       cljs.core/IHash
                       (t/Seqable x)
                       cljs.core/ICounted
                       (cljs.core/ILookup x)
                       cljs.core/ISet
                       ;; TODO IFn
                       ;; TODO cljs.core/IEditableCollection
                       ))))

(t/defalias
  ^{:doc "A sorted collection."
    :forms '[(t/Sorted x)]}
  t/Sorted
  (t/TFn [[x :variance :invariant]]
         #?(:clj (clojure.lang.Sorted x)
            :cljs (cljs.core/ISorted x))))

(t/defalias
  ^{:doc "A sorted persistent set with member type x"
    :forms '[(SortedSet x)]}
  t/SortedSet
  (t/TFn [[x :variance :invariant]]
         (t/I (t/Set x)
              (t/Sorted x))))

(t/defalias
  ^{:doc "A sorted persistent map with key type k and value type v"
    :forms '[(SortedMap x)]}
  t/SortedMap
  (t/TFn [[k :variance :invariant]
          [v :variance :covariant]]
         (t/I (t/Map k v)
              (t/Sorted k))))

(t/defalias
  ^{:doc "A type that can be used to create a sequence of member type x
         with count greater than 0."
    :forms '[(NonEmptySeqable x)]}
  t/NonEmptySeqable 
  (t/TFn [[x :variance :covariant]]
         (t/I (t/Seqable x)
              t/NonEmptyCount)))

(t/defalias
  ^{:doc "A type that can be used to create a sequence of member type x
         with count 0."
    :forms '[(EmptySeqable x)]}
  t/EmptySeqable
  (t/TFn [[x :variance :covariant]]
         (t/I (t/Seqable x)
              t/EmptyCount)))

(t/defalias
  ^{:doc "A persistent sequence of member type x."
    :forms '[(Seq x)]}
  t/Seq
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.ISeq x)
            :cljs (t/I (cljs.core/ISeq x)
                       cljs.core/IWithMeta
                       cljs.core/IMeta
                       (t/Seqable x)
                       (cljs.core/IIterable x)
                       ;(cljs.core/INext x)
                       cljs.core/ICollection
                       cljs.core/IEmptyableCollection
                       cljs.core/ISequential
                       cljs.core/IEquiv))))

(t/defalias
  ^{:doc "A persistent sequence of member type x with count greater than 0."
    :forms '[(NonEmptySeq x)]}
  t/NonEmptySeq
  (t/TFn [[x :variance :covariant]]
         (t/I (t/Seq x)
              t/NonEmptyCount)))

(t/defalias
  ^{:doc "A persistent sequence of member type x with count greater than 0, or nil."
    :forms '[(NilableNonEmptySeq x)]}
  t/NilableNonEmptySeq
  (t/TFn [[x :variance :covariant]]
         (t/Nilable
           (t/NonEmptySeq x))))

(t/defalias
  ^{:doc "A persistent sequence with count greater than 0, or nil."
    :forms '[AnyNilableNonEmptySeq]}
  t/AnyNilableNonEmptySeq
  (t/NilableNonEmptySeq t/Any))

(t/defalias
  ^{:doc "A hierarchy for use with derive, isa? etc."
    :forms '[Hierarchy]}
  t/Hierarchy
  '{:parents (t/Map t/Any t/Any)
    :ancestors (t/Map t/Any t/Any)
    :descendants (t/Map t/Any t/Any)})

(t/defalias
  ^{:doc "A Clojure derefable (see clojure.core/deref)."
    :forms '[(Deref x)]}
  t/Deref
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IDeref x)
            ;; note: IDerefWithTimeout not used in cljs
            :cljs (cljs.core/IDeref x))))

#?(:clj
(t/defalias
  ^{:doc "A Clojure future (see clojure.core/{future-call,future})."
    :forms '[(Future x)]}
  t/Future 
  (t/TFn [[x :variance :covariant]]
         (t/I (t/Deref x)
              (clojure.lang.IBlockingDeref x)
              clojure.lang.IPending
              java.util.concurrent.Future))))

#?(:clj
(t/defalias
  ^{:doc "A Clojure promise (see clojure.core/{promise,deliver})."
    :forms '[(Promise x)]}
  t/Promise 
  (t/TFn [[x :variance :invariant]]
         (t/I (t/Deref x)
              (clojure.lang.IBlockingDeref x)
              clojure.lang.IPending
              ;; FIXME I think this might be an implementation detail.
              [x :-> (t/Nilable (t/Promise x))]))))

(t/defalias
  ^{:doc "A Clojure delay (see clojure.core/{delay,force})."
    :forms '[(Delay x)]}
  t/Delay
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.Delay x)
            :cljs (cljs.core/Delay x))))

(t/defalias
  ^{:doc "A Clojure blocking derefable (see clojure.core/deref)."
    :forms '[(BlockingDeref x)]}
  t/BlockingDeref
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IBlockingDeref x)
            :cljs (cljs.core/IDerefWithTimeout x))))

(t/defalias
  ^{:doc "A Clojure persistent list."
    :forms '[(List x)]}
  t/List
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentList x)
            :cljs (t/I (cljs.core/IStack x)
                       cljs.core/IList
                       cljs.core/ICloneable
                       cljs.core/IWithMeta
                       cljs.core/IMeta
                       cljs.core/ASeq
                       (cljs.core/ISeq x)
                       cljs.core/ICollection
                       cljs.core/IEmptyableCollection
                       cljs.core/ISequential))))
(t/defalias
  ^{:doc "A Clojure custom exception type."
    :forms '[ExInfo]}
  t/ExInfo
  #?(:clj (t/I clojure.lang.IExceptionInfo
               RuntimeException)
     :cljs cljs.core/ExceptionInfo))

(t/defalias
  ^{:doc "A Clojure proxy."
    :forms '[Proxy]}
  t/Proxy
  clojure.lang.IProxy)

(t/defalias
  ^{:doc "A Clojure stack."
    :forms '[(Stack x)]}
  t/Stack
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.IPersistentStack x)
            :cljs (cljs.core/IStack x))))

(t/defalias
  ^{:doc "A sequential collection."
    :forms '[Sequential]}
  t/Sequential
  #?(:clj clojure.lang.Sequential
     :cljs cljs.core/ISequential))

(t/defalias
  ^{:doc "A sequential, seqable collection. Seq's aren't always Sequential."
    :forms '[(SequentialSeqable x)]}
  t/SequentialSeqable
  (t/TFn [[x :variance :covariant]]
         (t/I t/Sequential
              (t/Seqable x))))

(t/defalias
  ^{:doc "A sequential, seqable Clojure collection."
    :forms '[(SequentialColl x)]}
  t/SequentialColl
  (t/TFn [[x :variance :covariant]]
         (t/I t/Sequential
              (t/Coll x))))

(t/defalias
  ^{:doc "A Clojure sequential sequence. Seq's aren't always Sequential."
    :forms '[(SequentialSeq x)]}
  t/SequentialSeq
  (t/TFn [[x :variance :covariant]]
         (t/I t/Sequential
              (t/Seq x))))

(t/defalias
  ^{:doc "A sequential seq returned from clojure.core/seq"
    :forms '[(ASeq x)]}
  t/ASeq
  (t/TFn [[x :variance :covariant]]
         (t/I (t/SequentialSeq x)
              #?@(:clj [(Iterable x)
                        (java.util.Collection x)
                        (java.util.List x)
                        clojure.lang.IObj]))))

(t/defalias
  ^{:doc "A sequential non-empty seq retured from clojure.core/seq"
    :forms '[(NonEmptyASeq x)]}
  t/NonEmptyASeq
  (t/TFn [[x :variance :covariant]]
         (t/I (t/ASeq x)
              t/NonEmptyCount)))

(t/defalias
  ^{:doc "The result of clojure.core/seq."
    :forms '[(NilableNonEmptyASeq x)]}
  t/NilableNonEmptyASeq
  (t/TFn [[x :variance :covariant]]
         (t/Nilable
           (t/NonEmptyASeq x))))

(t/defalias
  ^{:doc "A type that returns true for clojure.core/fn?"
    :forms '[Fn]}
  t/Fn
  #?(:clj clojure.lang.Fn
     :cljs (t/U cljs.core/Fn
                ;;TODO 
                #_js/Function)))

(t/defalias
  ^{:doc "A Clojure multimethod."
    :forms '[Multi]}
  t/Multi
  clojure.lang.MultiFn)

(t/defalias
  ^{:doc "A reduced value of type x."
    :forms '[(t/Reduced x)]}
  t/Reduced
  (t/TFn [[x :variance :covariant]]
         #?(:clj (clojure.lang.Reduced x)
            :cljs (cljs.core/Reduced x))))

(t/defalias
  ^{:doc "A reducer function with accumulator a and reduces over collections of b"
    :forms '[(Reducer a b)]}
  t/Reducer
  (t/TFn [[a :variance :contravariant]
          [b :variance :invariant]]
         (t/IFn 
           ;init+complete
           [(t/? b) :-> b]
           ;step
           [b a :-> (t/U b (t/Reduced b))])))

(t/defalias
  ^{:doc "A transducer function that transforms in to out."
    :forms '[(Transducer in out)]}
  t/Transducer
  (t/TFn [[in :variance :contravariant]
          [out :variance :covariant]]
         ;; note: putting t/Transducer in an IFn makes r existential (but only in contravariant position IIUC? need to revisit my notes)
         ;; Stephen Dolan noted this when I showed him the type of `into`.
         ;; eg., Simulating Existential Types https://www.cs.cmu.edu/~fp/courses/15312-f04/assignments/asst5.pdf
         (t/All [r]
                [(t/Reducer out r) :-> (t/Reducer in r)])))

(t/defalias
  t/Comparable
  (t/TFn [[x :variance :invariant]]
         #?(:clj (Comparable x)
            :cljs (cljs.core/IComparable x))))

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]
])

#?@(:cljs [] :default [
cc/alias [t/Sym t/Sym :-> nil]
cc/all-ns [:-> (t/NilableNonEmptyASeq t/Namespace)]
])
nasa/Common-Metadata-Repository
(ns cmr.client.dev
  "The CMR client Clojure REPL development namespace."
  (:require
   [clojure.core.async :as async]
   [clojure.data.json :as json]
   [clojure.data.xml :as xml]
   [clojure.java.io :as io]
   [clojure.pprint :refer [pprint]]
   [clojure.string :as string]
   [clojure.tools.namespace.repl :as repl]
   [cmr.client.ac :as ac]
   [cmr.client.common.const :as const]
   [cmr.client.common.util :as util]
   [cmr.client.http.core :as http]
   [cmr.client.ingest :as ingest]
   [cmr.client.search :as search]
   [cmr.client.testing.runner :as runner]
   [cmr.client.tests]
   [ltest.core :as ltest]))

(def reload
   "An alias for `repl/refresh`"
   #'repl/refresh)

(def refresh
   "An alias for `repl/refresh`"
   #'repl/refresh)

(def reset
   "An alias for `repl/refresh`"
   #'repl/refresh)
clojureverse/clojurians-log-app
(ns repl.reactions
  (:require [clojurians-log.application :as app]
            [clojure.java.io :as io]
            [clojurians-log.slack-api :as slack]
            [clojurians-log.db.queries :as q]
            [clojurians-log.db.import :as import]
            [clojurians-log.data :as data]
            [clj-slack.emoji :as slack-emoji]
            [clojure.java.io :as io]
            [clojurians-log.datomic :as d]
            [clojure.tools.reader.edn :as edn]
            [clojure.string :as str]
            [clojure.core.async :as async :refer [>!! <! >! go-loop go <!!]]
            [clojure.data.json :as json])
  (:use [clojurians-log.repl]))

  (into {} (map (comp first #(for [alias (:aliases %)] [alias (:emoji %)])) emlist))
  
  (d/transact (conn) default-emojis)
  (d/q '[:find (pull ?e [*]) :where [?e :emoji/shortcode]] (db))
  
  (def emcoll (slack-emoji/list {:api-url "https://slack.com/api"
   ;; TODO: get rid of this global config access
                                 :token ""}))
  
  (doseq [emojis (partition-all 1000 (:emoji emcoll))]
    @(d/transact (conn) (mapv import/emoji->tx emojis)))
  
  (load-demo-data! "../clojurians-log-demo-data2")
  )
ToxicFrog/bltool
(ns bltool.data.default
  (:require [bltool.flags :refer :all])
  (:require [clojure.core.typed :as t :refer [fn> ann]])
  (:require [slingshot.slingshot :refer [throw+]]))

(t/def-alias BLGame '{:id String :name String :platform String :progress String})
(t/def-alias BLGameList (t/Vec BLGame))