Skip to content

Instantly share code, notes, and snippets.

(ns om-tut.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[clojure.string :as string]))
(enable-console-print!)
(def app-state
(atom
{:people
(def place-settings 5)
(def chopsticks (repeatedly place-settings #(ref true)))
(def philosophers (map #(agent %) (partition 2 1 chopsticks chopsticks)))
(defn sleep [] (Thread/sleep (rand-int 1000)))
(def eat sleep)
(def think sleep)
(defn toggle-chopsticks [cs pred?]
(dosync