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
class ModelParser extends JavaTokenParsers { | |
def packageParser: Parser[PackageAST] = ident ~ "{" ~ rep(typeParser) ~ "}" ^^ | |
{ case name ~ "{" ~ types ~ "}" => new PackageAST(name, types) } | |
def typeParser: Parser[TypeAST] = ident ~ opt(":" ~> repsep(ident,",")) ~ opt("{" ~> rep(propertyParser) <~ "}") ^^ | |
{ case name ~ superTypes ~ properties => new TypeAST(name,superTypes,properties) } | |
def propertyParser: Parser[PropertyAST] = ident ~ ":" ~ ident ^^ | |
{ case name ~ ":" ~ range => new PropertyAST(name,range) } |
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
public interface IKaivoDatabase { | |
void add(String subject, String predicate, String object); | |
void addWithObjectIndex(String subject, String predicate, String object, int index); | |
void addWithSubjectIndex(String node, String predicate, String newValue, int index); | |
void remove(String subject, String predicate, String object); | |
void removeObject(String subject, String predicate, int objectIndex); | |
void removeSubject(String object, String predicate, int subjectIndex); | |
void changeObject(String subject, String predicate, int index, String newObject); |
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
org.sidos.metamodel{ | |
string | |
number | |
} | |
fi.sirunsivut.persons { | |
import org.sidos.metamodel | |
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 apropos | |
"Returns list of namespace - symbol pairs matching a symbol name pattern" | |
[pattern] | |
(apply concat (for [ns (all-ns)] | |
(for [symbol-name (keys (ns-publics ns)) | |
:when (.contains (str symbol-name) | |
pattern)] | |
(list (ns-name ns) | |
symbol-name))))) |
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
(defun clojure-reset-namespace () | |
"Reloads the current Clojure namespace by first removing it and | |
then re-evaluating the slime buffer. Use this to remove old | |
symbol definitions and reset the namespace to contain only what | |
is defined in your current Emacs buffer." | |
(interactive) | |
(save-buffer) | |
(slime-interactive-eval (concat "(remove-ns '" (slime-current-package) ")")) | |
(slime-compile-and-load-file)) |
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- load [image-list] | |
(when (:needs-to-load image-list) | |
(quad-buffer/load (:quad-buffer image-list)) | |
(quad-list/load (:quad-list image-list)) | |
(texture-atlas/load (:texture-atlas image-list))) | |
(assoc image-list :needs-to-load false)) | |
(defn- draw-image-list [image-list] | |
(draw/draw-quads (:vertex-buffer-id (:quad-buffer image-list)) | |
(:texture-coordinate-buffer-id (:texture-atlas image-list)) |
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- handle-input [input state-changes event] | |
(-> input | |
(assoc :past-states (conj (:past-states input) | |
(:current-state input))) | |
(assoc :current-state (apply assoc input-state | |
(concat state-changes | |
[:last-event event | |
:time (System/nanoTime)]))))) | |
(defn handle-mouse-button-press [input lwjgl-event] |
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 combined-key-code [key-code] | |
(case key-code | |
left-shift :shift | |
right-shift :shift | |
left-control :control | |
right-control :control | |
left-alt :alt | |
alt-gr :alt | |
nil)) |
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
;.;. [31mFAIL[0m at (NO_SOURCE_FILE:1) | |
;.;. Expected: [{:y 20, :x 10, :height 10} {:y 30, :x 10, :height 15} {:y 45, :x 10, :height 10}] | |
;.;. Actual: java.lang.ClassCastException: clojure_lwjgl.applications.traditional$eval6058$fn__6059$fn$reify__6061 cannot be cast to clojure.lang.Associative | |
;.;. clojure_lwjgl.applications.traditional$vertical_stack.invoke(traditional.clj:50) | |
;.;. clojure_lwjgl.applications.traditional$eval6058$fn__6059$fn__6060.invoke(NO_SOURCE_FILE:1) | |
;.;. clojure_lwjgl.applications.traditional$eval6058$fn__6059.invoke(NO_SOURCE_FILE:1) | |
;.;. clojure_lwjgl.applications.traditional$eval6058.invoke(NO_SOURCE_FILE:1) | |
;.;. clojure_lwjgl.applications.traditional$eval6054.invoke(NO_SOURCE_FILE) | |
(fact "vertical stack sets x and y coordinates" |
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
Create new entity and insert it to a collection. Return the modified collection and the new entity | |
(let [updated-collection new-entity] (add-entity collection)) | |
OlderNewer