edn-query-language / eql

EQL is a declarative way to make hierarchical (and possibly nested) selections of information about data requirements. This repository contains the base specs and definitions for EQL parsing, AST, etc.
http://edn-query-language.org
MIT License
381 stars 18 forks source link

Specification draft #1

Closed wilkerlucio closed 5 years ago

wilkerlucio commented 5 years ago

This is the first draft of the specs, I appreciate any input about how to better clarify each section and English corrections.

ikitommi commented 5 years ago

Could the mutations allow vectors with first element being a symbol too? Why? Vectors are nicer if you are creating the syntax programmatically:

['(add-customer {:name (if true "tommi" "pommi")})]
; [(add-customer {:name (if true "tommi" "pommi")})]

[(list 'add-customer {:name (if true "tommi" "pommi")})]
; [(add-customer {:name "tommi"})]

[['add-customer {:name (if true "tommi" "pommi")}]]
; [[add-customer {:name "tommi"}]]

there would still be parameters using the list syntax...

ikitommi commented 5 years ago

... or is the preferred way to use syntax-quote & unquote & unquote-splicing?

[`(add-customer {:name ~(if true "tommi" "pommi")})]
; [(user/add-customer {:name "tommi"})]
wilkerlucio commented 5 years ago

@ikitommi thanks for the feedback, all the options you said are good, I'm trying to avoid for changes in the syntax at this moment since this is just re-using the same that's been working for quite a time, I think lists for calls also make good to explicitly and match Clojure function calls (which they are very much like). Today currently on Fulcro the most common thing is using quote & unquote like you mentioned.

awkay commented 5 years ago

The existing call syntax is preferable, since it looks like what it is meant to be: a call. The trick in fulcro incubator about declared mutations eliminates the need for the syntax quoting as well, and as Wilker says it has been working for years quite well now.