I hereby claim:
- I am yvendruscolo on github.
- I am yorggen (https://keybase.io/yorggen) on keybase.
- I have a public key ASDqLdUfP3b0deCu7XZZ14NCNK9b3tz1reDa9vnZtJBCKgo
To claim this, I am signing this object:
->: make op! :function ; arrow-style lambdas: [x]->[x + 1] | |
id: ["Identity function, one in, same out" x]->[x] | |
;-------------------------------------------------------------------------------------- | |
cmp: ["Gets a block! of words! or blcoks! that represent a function! and composes it in the usual way" | |
fs [any-block!]]->[ [x]-> compose/deep/only [take reduce append (reduce fs) [x] ] | |
] |
I hereby claim:
To claim this, I am signing this object:
if [ -x /usr/games/cowsay -a -x /usr/games/fortune ]; then | |
fortune | cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n1) | lolcat -a -d 1 --freq "0.$(shuf -i 1-10 -n 1)" --seed $RANDOM | |
fi |
I hereby claim:
To claim this, I am signing this object:
(defmacro dont | |
[& _] | |
(throw (ex-info "(╯°□°)╯︵ ┻━┻" {}))) | |
(dont | |
(defn add [a b] (+ a b))) |
(defmacro no-bangs! | |
[forms] | |
(if (->> forms | |
flatten | |
(filter symbol?) | |
(some (comp (partial re-find #"\!") name))) | |
(throw (ex-info "/(•̀o•́)ง No bangs!" {})) | |
forms)) | |
(no-bangs! |
(ns yvern.hard-rule | |
(:require [clara.rules :refer [defrule insert!]])) | |
(def $ (comp val first)) | |
(defrule all-together | |
[?middle <- :middle] | |
[:or | |
[:and [?max <- :top] [?min <- :bottom]] | |
[:and [?min <- :left] [?max <- :right]]] |
(defrule overflow? | |
[?middle <- :middle] | |
[:or [?max <- :top] [?max <- :right]] | |
[:test (<= ($ ?max) ($ ?middle))] | |
=> | |
(insert! {:fact-type :overflow!})) | |
(defrule underflow? | |
[?middle <- :middle] | |
[:or [?min <- :bottom] [?min <- :left]] |
(defrule not-ok | |
[:a] | |
=> | |
(when (< 0.5 (rand)) | |
(insert! {:fact-type :b}))) |
(ns yvern.defrule) | |
(def clara-inserts | |
"The forms we care about, capable of inserting facts." | |
#{'insert! 'insert-all!}) | |
(def descend* | |
"Transducer to descend into inner forms, looping for those we care about, the ones that insert facts. | |
Unfortunately we can't really figure out if someone defines another function that calls `insert!`." | |
(comp (map macroexpand) |