Skip to content

Instantly share code, notes, and snippets.

View maxcountryman's full-sized avatar
🦀

Max Countryman maxcountryman

🦀
View GitHub Profile
(definterface INode
(getNext [])
(setNext [n])
(getPrev [])
(setPrev [n]))
(deftype Node
[data
^:unsynchronized-mutable prev
^:unsynchronized-mutable next]
(definterface INode
(getCar [])
(setCar [x])
(getCdr [])
(setCdr [n])
(cons [x])
(reverse []))
(deftype Node
[^:volatile-mutable car ^:volatile-mutable ^INode cdr]
(ns datastructures.skip-list)
(defn lt [a b]
(if (nil? a)
false
(case (compare a b)
1 false
0 false
-1 true)))
(ns brander.core
(:require [clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as string]))
(def words
(lazy-seq
(with-open [r (io/reader "/usr/share/dict/words")]
(doall (map (comp string/lower-case string/trim) (line-seq r))))))

HTTP Interface

Skuld exposes an HTTP interface on a per-node basis. The available endpoints are outlined below.

Queue

Count queues

Where r is the read concern.

;; Singly-Linked List
(definterface INode
(getCar [])
(getCdr [])
(setCar [x])
(setCdr [x]))
(deftype Node
[^:volatile-mutable car ^:volatile-mutable cdr]
INode
(definterface INode
(getCar [])
(getCdr [])
(setCar [x])
(setCdr [x]))
(deftype Node
[^:volatile-mutable car ^:volatile-mutable cdr]
INode
(getCar [_] car)
;; Singly-Linked List
(definterface INode
(getCar [])
(getCdr [])
(setCar [x])
(setCdr [x]))
(deftype Node
[^:volatile-mutable car ^:volatile-mutable cdr]
INode
;; Singly-Linked List
(definterface INode
(getCar [])
(getCdr [])
(setCar [x])
(setCdr [x]))
(deftype Node [^:volatile-mutable car ^:volatile-mutable cdr]
INode
(getCar [_] car)
(definterface INode
(getCar [])
(getCdr [])
(setCar [x])
(setCdr [x])
(valAt [i]))
(deftype Node [^:volatile-mutable car ^:volatile-mutable cdr]
INode
(getCar [_] car)