Fork me on GitHub
#off-topic
<
2020-07-29
>
borkdude19:07:45

(require '[clojure.string :as str])

(defmacro fmt [s & args]
  `(format ~(str/replace s #"\{(\d+)\}" (fn [[_ i]] (str "%" i "$s"))) ~@args))

(fmt "{2} - {1}" :foo :bar) ;;=> ":bar - :foo"

😂 6
🚀 6
Drew Verlee19:07:58

Whats the name of the higher level concept above assignment and filtering as In "assign A to 3" AND "give me the A that is 3" probably have a unified concept behind them.

Drew Verlee20:07:24

or at least, whats the name for the function of the later. It's like filter

Drew Verlee20:07:06

i guess in set theory its a join

dpsutton20:07:04

not following what you're after. set theory would normally talk of unions not joins

👍 3
dpsutton20:07:16

or cross products

noisesmith20:07:44

@drewverlee like in math, "for all a, where a=3" as opposed to "for all a, a=3"?

noisesmith20:07:59

it sounds like you are more interested in defining an algorithm or procedure though, where the normal thing in most mathematical fields is to show something exists, and the algorithm or procedure is an implementation detail of a proof

Drew Verlee20:07:30

Maybe their isn't a higher level relationship. One is assignment. I"m lacking a good way to describe the other. "for all a, where a=3"

Drew Verlee20:07:16

A related concept would be how Datomic clauses are ___ in order to realize the values. Thats what prompted me to think of join.

jsn20:07:14

unification?...

Drew Verlee20:07:58

I believe thats correct, though i'm not sure i understand the full scope of the idea. A quick search of prolog terminology came up with the same word. It seems good enough for my current use. 🙂

phronmophobic20:07:19

it sounds like "select" to me

noisesmith20:07:30

sounds like the channel has unified on an answer

jsn20:07:56

how eventually consistent of it