Last active
November 10, 2018 14:29
-
-
Save dustingetz/3704ee0d3fe2f8df54c848cb1fe183c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.core.match :refer [match]]) | |
(require '[datascript.parser :refer [parse-query]]) | |
(import (datascript.parser FindRel FindColl FindTuple FindScalar Variable Aggregate Pull)) | |
(def q '[:find [?e ...] :where [?e :db/ident]]) | |
(let [FindColl FindColl ; Create locals for symbols | |
FindScalar FindScalar | |
FindRel FindRel | |
FindTuple FindTuple] | |
(match [(type (:qfind (parse-query q)))] | |
[FindRel] :rel ; match searches locals first before binding wildcards | |
[FindColl] :coll | |
[FindScalar] :scalar | |
[FindTuple] :tuple)) | |
; => :coll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment