          (catch EntityNotFoundException e (throw e))
          (catch Exception e (throw e)))]
     (EntityMap. e)))
-
-;; core.clj:
-;; (defn iterator-seq
-;;   "Returns a seq on a java.util.Iterator. Note that most collections
-;;   providing iterators implement Iterable and thus support seq directly."
-;;   {:added "1.0"
-;;    :static true}
-;;   [iter]
-;;   (clojure.lang.IteratorSeq/create iter))
-
 
 ;; Kind query
 (defmethod emaps?? 'Kind               ; e.g. :Foo

       (if (= (class coll) Entity)
         (EntityMap. coll)
         (log/trace "EXCEPTION assoc!!")))))

;;   ;; ([^clojure.lang.IPersistentVector coll propname val]
;;   ;;  )

;; (defmethod assoc!! Entity
;;   ([^com.google.appengine.api.datastore.Entity coll ^Keyword propname val]
;;      ;; e (Entity. k)]
;;   ([^com.google.appengine.api.datastore.Entity coll ^Keyword propname val & kvs]
;;    (.setProperty coll (subs (str propname) 1) val) ; setProperty returns void
;;    (if kvs
;;      (recur coll (first kvs) (second kvs) (nnext kvs))
;;      coll)))

;; (defmethod assoc!! EntityMap
;;   ([^EntityMap coll ^Keyword propname val]
;;    {:pre {[(nil? (clj/namespace propname))]}
;;    (let [txn (.beginTransaction (datastore))]
;;      ;; e (Entity. k)]
;;      (try
;;        (.setProperty coll (clj/name propname) val)
;;        (.put (datastore) coll)
;;        (.commit txn)
;;        (finally
;;          (if (.isActive txn)
;;            (.rollback txn))))
;;      coll))
;;   ([^com.google.appengine.api.datastore.Entity coll propname val & kvs]
;;    (.setProperty coll (subs (str propname) 1) val) ; setProperty returns void
;;    (if kvs
;;      (recur coll (first kvs) (second kvs) (nnext kvs))
;;      coll)))

;; (def
;;  ^{:arglists '([coll x] [coll x & xs])
;;    :doc "conj[oin]. Returns a new collection with the xs
;;     'added'. (conj nil item) returns (item).  The 'addition' may
;;     happen at different 'places' depending on the concrete type."
;;    :added "1.0"
;;    :static true}
;;  conj (fn ^:static conj
;;         ([coll x] (. clojure.lang.RT (conj coll x)))
;;         ([coll x & xs]
;;          (if xs
;;            (recur (conj coll x) (first xs) (next xs))
;;            (conj coll x)))))

;; (defn into
;;   "Returns a new coll consisting of to-coll with all of the items of
;;   from-coll conjoined."
;;   {:added "1.0"
;;    :static true}
;;   [to from]
;;   (if (instance? clojure.lang.IEditableCollection to)
;;     (with-meta (persistent! (reduce conj! (transient to) from)) (meta to))
;;     (reduce conj to from)))

(defmacro emaps!
  [kind pred]

(defmethod to-edn [EntityMap nil]
  [^EntityMap e]
  e)

(defmethod to-edn [Entity nil]
  ;;[com.google.appengine.api.datastore.Entity nil]
