datascript

2023-09-27T19:06:52.871959Z

I was experimenting with predicates in datascript and noticed that sometimes you have to fully qualify the predicate and sometimes you don’t, as in this example:

(d/q
  '[:find ?e
    :where
    [?e :name ?name]
    [?e :size ?size]
    ;; Requires full qualification
    [(clojure.core/string? ?name)]
    ;; Works as-is
    [(pos? ?size)]]
  (d/db-with
    (d/empty-db)
    [{:name "Bob" :size 4}]))
Is pos? a built-in? Is there a list of these or some other easy way to know when you need to qualify the predicate?