This file contains 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
(import '[clojure.asm Opcodes Type ClassWriter] | |
'[clojure.asm.commons Method GeneratorAdapter]) | |
(defn make-class [name] | |
(let [cw (ClassWriter. ClassWriter/COMPUTE_FRAMES) | |
init (Method/getMethod "void <init>()") | |
meth (Method/getMethod "int fact(int)")] | |
(.visit cw Opcodes/V1_6 Opcodes/ACC_PUBLIC (.replace name \. \/) nil "java/lang/Object" nil) | |
(doto (GeneratorAdapter. Opcodes/ACC_PUBLIC init nil nil cw) | |
(.visitCode) |
This file contains 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 lazy-sort) | |
(defn qsort [[head & tail]] | |
(when head | |
(lazy-cat (qsort (filter #(< % head) tail)) | |
[head] | |
(qsort (remove #(< % head) tail))))) | |
(defn merge* | |
[[f1 & r1 :as l1] [f2 & r2 :as l2]] |
This file contains 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 webdav | |
(:require [clojure.string :as str] | |
[clojure.data.xml :as xml] | |
[org.httpkit.server :as hk-server])) | |
;; add the XML namespace that we'll use later | |
(xml/alias-uri 'd "DAV:") | |
(defn dissoc-in | |
"Should be in the standard library..." |