; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By 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.
(in-ns 'clojure)
(def #^{:sigs '([& args])} list (. clojure.lang.PersistentList creator))
(def #^{:sigs '([x seq])} cons (fn* [x seq] (. clojure.lang.RT (cons x seq))))
;during bootstrap we don't have destructuring let or fn, will redefine later
(def #^{:macro true}
let (fn* [& decl] (cons 'let* decl)))
(def #^{:macro true}
fn (fn* [& decl] (cons 'fn* decl)))
(def #^{:sigs '([coll x])} conj (fn [coll x] (. clojure.lang.RT (conj coll x))))
(def #^{:sigs '([x])} first (fn [x] (. clojure.lang.RT (first x))))
(def #^{:sigs '([x])} rest (fn [x] (. clojure.lang.RT (rest x))))
(def #^{:sigs '([coll])} seq (fn [coll] (. clojure.lang.RT (seq coll))))
(def #^{:sigs '([#^Class c x])} instance? (fn [#^Class c x] (. c (isInstance x))))
(def #^{:sigs '([x])} seq? (fn [x] (instance? clojure.lang.ISeq x)))
(def #^{:private true}
sigs
(fn [fdecl]
(if (seq? (first fdecl))
(loop [ret [] fdecl fdecl]
(if fdecl
(recur (conj ret (first (first fdecl))) (rest fdecl))
(seq ret)))
(list (first fdecl)))))
(def #^{:sigs '([map key val])} assoc (fn [map key val] (. clojure.lang.RT (assoc map key val))))
;;;;;;;;;;;;;;;;; metadata ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def #^{:sigs '([x])} meta (fn [x]
(if (instance? clojure.lang.IObj x)
(. #^clojure.lang.IObj x (meta)))))
(def #^{:sigs '([#^clojure.lang.IObj x m])}