diff --git a/src/rw/create.clj b/src/rw/create.clj index 59378a1..9ce4fc3 100644 --- a/src/rw/create.clj +++ b/src/rw/create.clj @@ -1,4 +1,5 @@ -(ns rw.core +(ns rw.create + (:refer-clojure :exclude [compile]) (:use [clojure.string :only [split join]] [rw.lexicon :only [registers op-commands commands]])) diff --git a/src/rw/eval.clj b/src/rw/exec.clj similarity index 93% rename from src/rw/eval.clj rename to src/rw/exec.clj index bd6b9c8..847272a 100644 --- a/src/rw/eval.clj +++ b/src/rw/exec.clj @@ -1,11 +1,12 @@ -(ns rw.core +(ns rw.exec (:require (rw [lexicon :as lexicon]))) (def op-map (zipmap lexicon/op-commands - (map #(case % - "/" #(int (Math/round (float (/ %1 %2)))) - "#" not= - (read-string %)) + (map (fn [op] + (case op + "/" #(int (Math/round (float (/ %1 %2)))) + "#" not= + (read-string op))) lexicon/op-commands))) (defn resolve-register [registers reg] diff --git a/src/rw/lexicon.clj b/src/rw/lexicon.clj index 0b144cb..5aa5b3d 100644 --- a/src/rw/lexicon.clj +++ b/src/rw/lexicon.clj @@ -9,7 +9,7 @@ (def commands (concat op-commands word-commands)) -(def get-register-by-idx +(defn get-register-by-idx "to allow use of the INDEX/DATA register pair, we need to have a way of getting registers by their index, but starting from 1, not 0." [idx]