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
No message. | |
[Thrown class java.lang.IndexOutOfBoundsException] | |
Restarts: | |
0: [QUIT] Quit to the SLIME top level | |
1: [ABORT] ABORT to SLIME level 0 | |
Backtrace: | |
0: clojure.lang.PersistentVector.arrayFor(PersistentVector.java:106) | |
1: clojure.lang.PersistentVector.nth(PersistentVector.java:110) |
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
(defn get-complexes | |
"Returns a seq with the ids of the complexes in expr (which is a | |
map from id (Integer) to Kappa agent)." | |
[expr] | |
(if (:complexes (meta expr)) (:complexes (meta expr)) | |
(let [get-complex (partial complex expr)] | |
(loop [remaining expr | |
last-complex #{} | |
groups (transient [])] | |
(let [remaining (remove (comp last-complex key) remaining)] |
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
(add-to-list 'load-path (expand-file-name "~/emacs/lisp/auto-complete-1.2/")) | |
(require 'auto-complete-config) | |
(add-to-list 'ac-dictionary-directories "~/emacs/lisp/auto-complete-1.2/dict/") | |
(ac-config-default) |
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
(defrecord Agent [id name states bindings]) | |
(defn a1 [bs ba] | |
(Agent. 1 :a1 {"x" ""} {"x" [bs (delay (ba "x" a1))]})) | |
(defn a2 [bs ba] | |
(Agent. 2 :a2 {"z" ""} {"z" [bs (delay (ba "z" a2))]})) | |
;; user> (a1 "z" a2) ; why stack overflow? |
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
(defmacro multi-pred [& preds] | |
`(fn [& args] | |
(and ~@(for [pred preds] | |
`(apply ~pred args))))) |
NewerOlder