Skip to content

Instantly share code, notes, and snippets.

@whodidthis
whodidthis / numbers.clj
Created March 27, 2015 20:15
natural numbers in core.logic
(ns logic.numbers
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
; s is a list with a single element
(defn s [x y]
(conso x [] y))
; natural_number(0). natural_number(s(X)) :- natural_number(X).
(defn natural-number [x]
@whodidthis
whodidthis / queries.sql
Last active August 18, 2021 03:25
YES for pgmoon too, because YeSQL
-- name: get_cools
SELECT *
FROM cools
-- name: insert_a_cool
INSERT INTO cools
(name, why)
VALUES
(?, ?)
RETURNING level
(ns pondering
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [<! >! put! take! close! chan timeout]]))
; The "library" part
(def unique (atom 0))
(def id-channel (atom {}))
(def output (chan))
(def input (chan))