This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-10
Channels
- # adventofcode (54)
- # announcements (30)
- # asami (13)
- # aws (10)
- # babashka (16)
- # babashka-sci-dev (44)
- # beginners (95)
- # calva (63)
- # clara (10)
- # clj-kondo (3)
- # cljfx (6)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (68)
- # clojure-europe (59)
- # clojure-nl (7)
- # clojure-norway (12)
- # clojure-spec (6)
- # clojure-uk (6)
- # clojurescript (4)
- # component (4)
- # conjure (5)
- # datomic (3)
- # deps-new (1)
- # events (4)
- # exercism (1)
- # figwheel-main (1)
- # fulcro (33)
- # gratitude (1)
- # improve-getting-started (3)
- # jobs (3)
- # lsp (5)
- # malli (10)
- # membrane (5)
- # music (3)
- # nextjournal (6)
- # off-topic (42)
- # pedestal (2)
- # polylith (14)
- # portal (11)
- # re-frame (42)
- # releases (3)
- # reveal (4)
- # shadow-cljs (62)
- # tools-build (1)
- # tools-deps (3)
- # web-security (1)
- # xtdb (3)
Another idea I had was essentially passing a map where we had
{:city1-zip1-road1 "magic-value-1",
:city2-zip2-road2 "magic-value-2",
... ;; a few thousand of these
:fact-type :path}
(defn join-with-dash
[& args]
(apply str/join "-" args))
(defrule moo
[:account (= account "some-value") (= ?city city)]
[:route (= ?road road) (= ?zip zip) (= ?joined (join-str-with-dash ?city ?zip ?path))]
[:path (= ?found-path ?joined)]
...
=>
(println "do something"))
possibly faster, however that would be really tightly coupled to the data itself. In general, the comparisons to make the joins should be fast assuming they simple joins (field equality). I would probably start with a rule similar to the original rule, and do real world testing... if that proves too inefficient then come to the rule and tune it.