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 pie-a-la-mode | |
(:import [java.util.concurrent Executors])) | |
;; Concurrency example from The Pragmatic Programmers. Waiters check if there's | |
;; enough pie and ice cream before they sell an order, but if they don't | |
;; coordinate it's still possible to sell more than we have. | |
;; | |
;; The below code should return either :ok or :not-available for a given order. | |
;; If we oversell, then it will throw an exception. | |
;; |
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 demo.a | |
(:require [demo.b :refer [defcomp]])) | |
(defcomp my-comp [x y] 1) | |
(println my-comp) |
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 util.camelize-dasherize | |
(:import (clojure.lang IPersistentMap Keyword)) | |
(:require [clojure.string :as s] | |
[clojure.zip :as zip])) | |
; TODO: regex is slow, should try iterating the string. | |
(defn dasherize-string* | |
"Converts an underscored or camelized string | |
into an dasherized one." | |
[s] |