walkable-server / walkable

A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
https://walkable.gitlab.io/
Eclipse Public License 2.0
445 stars 15 forks source link

use named getter functions instead of lambda forms #86

Closed myguidingstar closed 5 years ago

myguidingstar commented 6 years ago

passing the whole big env to a lambda that produces expressions will make it harder to cache. Separate the getter functions. Currently:

(pseudo-column-λ env) ;; => expression
(extra-conditions-λ env) ;; => expression

should become:

(let [extracted-env (pseudo-column-getter env)]
  (pseudo-column-λ extracted-env)) ;; => expression (more cachable)
(let [extracted-env (pseudo-column-getter env)]
  (extra-conditions-λ extracted-env)) ;; => expression (more cachable)
myguidingstar commented 5 years ago

midleware system to share computation between such variable-getter functions