From 3cc8b4fd245b775944eb875dcf6e4cf40bdbf2c5 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Thu, 31 May 2018 11:33:03 -0700 Subject: [PATCH] Pre: Prefer [(pred ...)] to [[pred ...]] syntax. This is a style choice. We supported both, perhaps for Datomic compliance, but it's not the standard we use in our code base. In addition, it doesn't read like lisp (which is what EDN is copying), since [] is not function application in most lisps. It's also a convenience: I don't want to parse brackets that have to agree with `rust-peg`. It's not hard but it's also not worth doing. --- query-algebrizer/src/clauses/not.rs | 2 +- query-algebrizer/src/clauses/or.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/query-algebrizer/src/clauses/not.rs b/query-algebrizer/src/clauses/not.rs index 4d312023..43c0a901 100644 --- a/query-algebrizer/src/clauses/not.rs +++ b/query-algebrizer/src/clauses/not.rs @@ -338,7 +338,7 @@ mod testing { [:find ?x ?age :where [?x :foo/age ?age] - [[< ?age 30]] + [(< ?age 30)] (not [?x :foo/knows "John"] [?x :foo/knows "Daphne"])]"#; let cc = alg(&schema, query); diff --git a/query-algebrizer/src/clauses/or.rs b/query-algebrizer/src/clauses/or.rs index 39e8208f..e680a783 100644 --- a/query-algebrizer/src/clauses/or.rs +++ b/query-algebrizer/src/clauses/or.rs @@ -973,7 +973,7 @@ mod testing { [:find ?x ?age :where [?x :foo/age ?age] - [[< ?age 30]] + [(< ?age 30)] (or [?x :foo/knows "John"] [?x :foo/knows "Daphne"])]"#; let cc = alg(known, query);