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
| Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil) | |
| slime-one-line-ify(nil) | |
| slime-insert-xrefs((("(No location)" nil))) | |
| slime-show-xref-buffer((("(No location)" nil)) :calls "function1" "namespace1") | |
| slime-show-xrefs((("(No location)" nil)) :calls "function1" "namespace1") | |
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
| (defmacro match-record | |
| ([matches expr] | |
| `(match-record ~matches ~expr nil)) | |
| ([[record in] expr fail-expr] | |
| (println "Multimethods "(methods record-matcher) " class " (class record)) | |
| (println "Record matcher " (record-matcher record) " class record " (class record)) | |
| `(if-match [~(record-matcher record) ~in] ~expr ~fail-expr))) | |
| (match-record [(new-baz {:bar ?e} ) nil] | |
| (some #(match-record [(new-baz {:bar false}) %] true) e)) |
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
| (defroutes admin-app | |
| (GET "/sparql-ui" [query] | |
| (if query | |
| (let [result (dostuff)] | |
| {:body (apply str (template query result))}) | |
| {:body (apply str (template nil nil))})) | |
| (route/not-found "<h1>Page not found</h1>")) |
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
| (defn lvarify | |
| "Using _ for don't care types of values works fine when using the matche and conde | |
| macros directly, but not as well when other macros wrap it. This will walk a list, | |
| looking for _ values and swapping them for new logic variables. This translates into | |
| the same don't care values when using conde/matche directly." | |
| [sym-list] | |
| (vec (map #(if (= % '_) | |
| `(lvar) | |
| %) | |
| sym-list))) |
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
| (defmacro dbg (form) | |
| (let ((res (make-symbol "res")) | |
| (dbg-str (make-symbol "dbg-str"))) | |
| `(progn | |
| (let ((,res ,form)) | |
| (let ((,dbg-str (concat | |
| (prin1-to-string "Debugging--> ") | |
| (prin1-to-string ',form) | |
| (prin1-to-string "\n = ") |
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
| (defn lazy-dog | |
| "Like concat or lazy-cat but does not realize the outer seq" | |
| [coll] | |
| (concat | |
| (first coll) | |
| (lazy-seq | |
| (when-let [more (next coll)] | |
| (lazy-dog more))))) | |
| (defn make-lazy-seq [end] |
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
| On the host system | |
| ------------------- | |
| * Install the net-scp ruby gem: sudo gem install net-scp | |
| * Install the json gem: | |
| ** The gem needs to build a native extension, tell it where Xcode Command Line Tools is: sudo xcode-select -switch /Library/Developer/ | |
| ** Xcode CLT doesn't include xcrun, fake one with the script here: http://stackoverflow.com/questions/13041525/osx-10-8-xcrun-no-such-file-or-directory | |
| ** should be ready to build now: sudo gem install json | |
| * sudo gem install systemu | |
| * git clone git://github.com/puppetlabs/puppet-acceptance.git | |
| * cd puppet-acceptance |
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
| (defn inc-it [x] (+ x 1)) | |
| (let [hand-off-queue (java.util.concurrent.SynchronousQueue.) | |
| f1 (future-call | |
| (fn [] | |
| (with-redefs [inc-it (fn [x] (- x))] | |
| (.put hand-off-queue "foo") | |
| (inc-it 10)))) | |
| f2 (future-call | |
| (fn [] |
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
| -[ RECORD 1 ]--+------------------------------ | |
| datid | 17413 | |
| datname | puppetdb | |
| numbackends | 13 | |
| xact_commit | 238 | |
| xact_rollback | 2 | |
| blks_read | 314 | |
| blks_hit | 30109 | |
| tup_returned | 68458 | |
| tup_fetched | 16072 |
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 com.puppetlabs.test.slingshot | |
| (:require [slingshot.slingshot :refer [try+ throw+]] | |
| [slingshot.support :refer [wrap]] | |
| [slingshot.test] | |
| [clojure.test :refer :all] | |
| [clojure.pprint] | |
| [clojure.stacktrace :as st] | |
| [spyscope.core])) | |
| (defn wrapped? [^Throwable t] |
OlderNewer