• (add-tuples db & tupls)
Adds a collection of tuples to the db, as
(add-tuples db
[:rel-name :key-1 1 :key-2 2]
[:rel-name :key-1 2 :key-2 3])

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/datalog/database.clj:207 top

(defn add-tuples
  "Adds a collection of tuples to the db, as
   (add-tuples db
      [:rel-name :key-1 1 :key-2 2]
      [:rel-name :key-1 2 :key-2 3])"
  [db & tupls]
  (reduce #(add-tuple %1 (first %2) (apply hash-map (next %2))) db tupls))
Vars in clojure.contrib.datalog.database/add-tuples: apply defn first hash-map next reduce
Used in 0 other vars

Comments top

No comments for add-tuples. Log in to add a comment.