This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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" {})))) |