Skip to content

Instantly share code, notes, and snippets.

(ns useless-set-theoretic-numbers
"How do you arrive at numbers instead of starting with them?"
(:require [clojure.set]))
(def zero #{})
(defn successor [x] (conj x x))
(defn predecessor [x]
(if-not (= x zero)
(apply clojure.set/union x)
(throw (ex-info "Can't go below zero" {}))))