Skip to content

Instantly share code, notes, and snippets.

@debetimi
debetimi / circuits.clj
Last active August 29, 2015 13:58
Learning Clojure: Digital Circuits
(ns circuits.core)
(defn wire
"This is a wire. It takes an optional delay
keyword parameter and outputs a map with :i, and :o
which are atoms and :d which represents the delay
in milliseconds. The default delay is 0. When i changes value,
o follows in d number of seconds"
[& {:keys [del] :or {del 0}}]
(let [in (atom 0)
@debetimi
debetimi / package-manager.clj
Last active August 29, 2015 13:57
Learning Clojure - Package Manager
;;dddd
(ns package_manager
(:use [clojure.string :only [split, lower-case]]))
(def system (atom {}))
(def installed (atom (sorted-set)))
(def running (atom true))
(defn in? [coll elm]
(some #{elm} coll))