datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
lxsameer 2018-11-17T14:19:37.020600Z

hey folks, I can't understand the reason behind this line of code https://github.com/tonsky/datascript/blob/master/src/datascript/db.cljc#L733

lxsameer 2018-11-17T14:19:45.021100Z

can someone help me with it please ?

lxsameer 2018-11-17T14:20:01.021600Z

what is the reason behind that hashmap

ClashTheBunny 2018-11-17T15:04:01.021900Z

I think that's a clojure precondition.

ClashTheBunny 2018-11-17T15:04:22.022100Z

http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

ClashTheBunny 2018-11-17T15:06:03.023300Z

All it says is that, before you even try to do anything, make sure that (db? db) returns true. It checks to make sure that the right things are being passed (or returned) from the function.

lxsameer 2018-11-17T16:16:33.023800Z

interesting, didn't know about them