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
;;; This is my first pass at setting up virtual hosts; it works, but there is room for improvement. | |
;;; dependencies | |
;;[ring "1.1.5"] | |
;;[javax.servlet/servlet-api "2.5"] | |
;;[org.eclipse.jetty/jetty-server "7.6.1.v20120215"] | |
;;[org.eclipse.jetty/jetty-servlet "7.6.1.v20120215"] | |
(ns app.core | |
(:require [ring.util.servlet :refer (servlet)] |
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 replo | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic])) | |
(defn replo | |
"A relation between two sequences in and out, such that out is the | |
same as in, except that all occurences of k have been replaced with |
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 test | |
(:refer-clojure :exclude [==]) | |
(:require | |
[clojure.core.logic :refer :all])) | |
(defn foo [in out] | |
(matcha | |
[in out] | |
([('and a b . ()) ('and x y . ())] (foo a x) (foo b y)) | |
([a ('bar ('baz a . ()) . ())]))) |
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 pettomato.findall | |
(:refer-clojure :exclude [==]) | |
(:use | |
[clojure.core.logic.protocols]) | |
(:require | |
[clojure.core.logic :refer :all])) | |
(defn findall | |
"A goal that unifies l with a lazy sequence containing all possible | |
instantiations of v that could be generated by applying the goal g |
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
(let [out *out*] | |
(thread | |
(binding [*out* out | |
*err* out] | |
(try | |
(your-code-here) | |
(catch Throwable e (clojure.repl/pst e)))))) |