diff --git a/src/propeller/core.clj b/src/propeller/core.cljc similarity index 90% rename from src/propeller/core.clj rename to src/propeller/core.cljc index 5f4ac2a..6279fb3 100644 --- a/src/propeller/core.clj +++ b/src/propeller/core.cljc @@ -1,8 +1,9 @@ (ns propeller.core - (:gen-class) + #?(:clj (:gen-class)) (:require [propeller.gp :as gp] [propeller.problems.simple-regression :as regression] - [propeller.problems.string-classification :as string-classif])) + [propeller.problems.string-classification :as string-classif] + #?(:cljs [cljs.reader :refer [read-string]]))) (defn -main "Runs propel-gp, giving it a map of arguments." diff --git a/src/propeller/genome.clj b/src/propeller/genome.cljc similarity index 100% rename from src/propeller/genome.clj rename to src/propeller/genome.cljc diff --git a/src/propeller/gp.clj b/src/propeller/gp.cljc similarity index 96% rename from src/propeller/gp.clj rename to src/propeller/gp.cljc index 9a36b4b..f5f9088 100644 --- a/src/propeller/gp.clj +++ b/src/propeller/gp.cljc @@ -2,8 +2,8 @@ (:require [propeller.genome :as genome] [propeller.variation :as variation] [propeller.push.core :as push] - [propeller.push.instructions.boolean] - [propeller.push.instructions.char] + [propeller.push.instructions.bool] + [propeller.push.instructions.chara] [propeller.push.instructions.code] [propeller.push.instructions.input-output] [propeller.push.instructions.numeric] diff --git a/src/propeller/problems/simple_regression.clj b/src/propeller/problems/simple_regression.cljc similarity index 100% rename from src/propeller/problems/simple_regression.clj rename to src/propeller/problems/simple_regression.cljc diff --git a/src/propeller/problems/software/number_io.clj b/src/propeller/problems/software/number_io.cljc similarity index 100% rename from src/propeller/problems/software/number_io.clj rename to src/propeller/problems/software/number_io.cljc diff --git a/src/propeller/problems/string_classification.clj b/src/propeller/problems/string_classification.cljc similarity index 100% rename from src/propeller/problems/string_classification.clj rename to src/propeller/problems/string_classification.cljc diff --git a/src/propeller/push/core.clj b/src/propeller/push/core.cljc similarity index 100% rename from src/propeller/push/core.clj rename to src/propeller/push/core.cljc diff --git a/src/propeller/push/instructions/boolean.clj b/src/propeller/push/instructions/bool.cljc similarity index 85% rename from src/propeller/push/instructions/boolean.clj rename to src/propeller/push/instructions/bool.cljc index a4a0528..a44551d 100644 --- a/src/propeller/push/instructions/boolean.clj +++ b/src/propeller/push/instructions/bool.cljc @@ -1,7 +1,8 @@ -(ns propeller.push.instructions.boolean - (:require [propeller.push.utils :refer [def-instruction - make-instruction]])) - +(ns propeller.push.instructions.bool + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + make-instruction]])) + (:require #?(:clj [propeller.push.utils :refer [def-instruction + make-instruction]]))) ;; ============================================================================= ;; BOOLEAN Instructions ;; ============================================================================= diff --git a/src/propeller/push/instructions/char.clj b/src/propeller/push/instructions/chara.cljc similarity index 85% rename from src/propeller/push/instructions/char.clj rename to src/propeller/push/instructions/chara.cljc index c411b15..9133035 100644 --- a/src/propeller/push/instructions/char.clj +++ b/src/propeller/push/instructions/chara.cljc @@ -1,8 +1,10 @@ -(ns propeller.push.instructions.char +(ns propeller.push.instructions.chara + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + make-instruction]])) (:require [propeller.push.state :as state] - [propeller.push.utils :refer [def-instruction - make-instruction]] - [propeller.tools.character :as char])) + [propeller.tools.character :as char] + #?(:clj [propeller.push.utils :refer [def-instruction + make-instruction]]))) ;; ============================================================================= ;; CHAR Instructions diff --git a/src/propeller/push/instructions/code.clj b/src/propeller/push/instructions/code.cljc similarity index 83% rename from src/propeller/push/instructions/code.clj rename to src/propeller/push/instructions/code.cljc index c52051f..1cfea9c 100644 --- a/src/propeller/push/instructions/code.clj +++ b/src/propeller/push/instructions/code.cljc @@ -1,9 +1,12 @@ (ns propeller.push.instructions.code + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]])) (:require [propeller.utils :as utils] [propeller.push.state :as state] - [propeller.push.utils :refer [def-instruction - generate-instructions - make-instruction]])) + #?(:clj [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]]))) ;; ============================================================================= ;; Polymorphic Instructions diff --git a/src/propeller/push/instructions/input_output.clj b/src/propeller/push/instructions/input_output.cljc similarity index 88% rename from src/propeller/push/instructions/input_output.clj rename to src/propeller/push/instructions/input_output.cljc index 6b4b111..4753829 100644 --- a/src/propeller/push/instructions/input_output.clj +++ b/src/propeller/push/instructions/input_output.cljc @@ -1,7 +1,9 @@ (ns propeller.push.instructions.input-output + #?(:cljs (:require-macros [propeller.push.utils :refer + [def-instruction generate-instructions]])) (:require [propeller.push.state :as state] - [propeller.push.utils :refer [def-instruction - generate-instructions]])) + #?(:clj [propeller.push.utils :refer [def-instruction + generate-instructions]]))) ;; ============================================================================= ;; INPUT Instructions diff --git a/src/propeller/push/instructions/numeric.clj b/src/propeller/push/instructions/numeric.cljc similarity index 91% rename from src/propeller/push/instructions/numeric.clj rename to src/propeller/push/instructions/numeric.cljc index 20e17a7..784be70 100644 --- a/src/propeller/push/instructions/numeric.clj +++ b/src/propeller/push/instructions/numeric.cljc @@ -1,8 +1,11 @@ (ns propeller.push.instructions.numeric - (:require [propeller.push.utils :refer [def-instruction - generate-instructions - make-instruction]] - [propeller.tools.math :as math])) + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]])) + (:require [propeller.tools.math :as math] + #?(:clj [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]]))) ;; ============================================================================= ;; FLOAT and INTEGER Instructions (polymorphic) diff --git a/src/propeller/push/instructions/polymorphic.clj b/src/propeller/push/instructions/polymorphic.cljc similarity index 95% rename from src/propeller/push/instructions/polymorphic.clj rename to src/propeller/push/instructions/polymorphic.cljc index ca0d8da..b690d00 100644 --- a/src/propeller/push/instructions/polymorphic.clj +++ b/src/propeller/push/instructions/polymorphic.cljc @@ -1,8 +1,10 @@ (ns propeller.push.instructions.polymorphic + #?(:cljs (:require-macros [propeller.push.utils :refer [generate-instructions + make-instruction]])) (:require [propeller.utils :as utils] [propeller.push.state :as state] - [propeller.push.utils :refer [generate-instructions - make-instruction]])) + #?(:clj [propeller.push.utils :refer [generate-instructions + make-instruction]]))) ;; ============================================================================= ;; Polymorphic Instructions diff --git a/src/propeller/push/instructions/random.clj b/src/propeller/push/instructions/random.clj deleted file mode 100644 index 87a83e8..0000000 --- a/src/propeller/push/instructions/random.clj +++ /dev/null @@ -1,4 +0,0 @@ -(ns propeller.push.instructions.random - (:require [propeller.push.utils :refer [def-instruction]])) - - diff --git a/src/propeller/push/instructions/random.cljc b/src/propeller/push/instructions/random.cljc new file mode 100644 index 0000000..8fb64da --- /dev/null +++ b/src/propeller/push/instructions/random.cljc @@ -0,0 +1,5 @@ +(ns propeller.push.instructions.random + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction]])) + #?(:clj (:require [propeller.push.utils :refer [def-instruction]]))) + + diff --git a/src/propeller/push/instructions/string.clj b/src/propeller/push/instructions/string.cljc similarity index 81% rename from src/propeller/push/instructions/string.clj rename to src/propeller/push/instructions/string.cljc index aa1f839..c2b92d2 100644 --- a/src/propeller/push/instructions/string.clj +++ b/src/propeller/push/instructions/string.cljc @@ -1,6 +1,9 @@ (ns propeller.push.instructions.string - (:require [propeller.push.utils :refer [def-instruction - make-instruction]])) + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + make-instruction]])) + + (:require #?(:clj [propeller.push.utils :refer [def-instruction + make-instruction]]))) ;; ============================================================================= ;; STRING Instructions diff --git a/src/propeller/push/instructions/vector.clj b/src/propeller/push/instructions/vector.cljc similarity index 94% rename from src/propeller/push/instructions/vector.clj rename to src/propeller/push/instructions/vector.cljc index 6891504..6f7c50b 100644 --- a/src/propeller/push/instructions/vector.clj +++ b/src/propeller/push/instructions/vector.cljc @@ -1,10 +1,13 @@ (ns propeller.push.instructions.vector + #?(:cljs (:require-macros [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]])) (:require [clojure.string] [propeller.utils :as utils] [propeller.push.state :as state] - [propeller.push.utils :refer [def-instruction - generate-instructions - make-instruction]])) + #?(:clj [propeller.push.utils :refer [def-instruction + generate-instructions + make-instruction]]))) ;; ============================================================================= ;; VECTOR Instructions diff --git a/src/propeller/push/interpreter.clj b/src/propeller/push/interpreter.cljc similarity index 100% rename from src/propeller/push/interpreter.clj rename to src/propeller/push/interpreter.cljc diff --git a/src/propeller/push/state.clj b/src/propeller/push/state.cljc similarity index 100% rename from src/propeller/push/state.clj rename to src/propeller/push/state.cljc diff --git a/src/propeller/push/utils.clj b/src/propeller/push/utils.cljc similarity index 100% rename from src/propeller/push/utils.clj rename to src/propeller/push/utils.cljc diff --git a/src/propeller/selection.clj b/src/propeller/selection.cljc similarity index 100% rename from src/propeller/selection.clj rename to src/propeller/selection.cljc diff --git a/src/propeller/session.clj b/src/propeller/session.cljc similarity index 100% rename from src/propeller/session.clj rename to src/propeller/session.cljc diff --git a/src/propeller/tools/character.clj b/src/propeller/tools/character.cljc similarity index 100% rename from src/propeller/tools/character.clj rename to src/propeller/tools/character.cljc diff --git a/src/propeller/tools/metrics.clj b/src/propeller/tools/metrics.cljc similarity index 100% rename from src/propeller/tools/metrics.clj rename to src/propeller/tools/metrics.cljc diff --git a/src/propeller/utils.clj b/src/propeller/utils.cljc similarity index 100% rename from src/propeller/utils.clj rename to src/propeller/utils.cljc diff --git a/src/propeller/variation.clj b/src/propeller/variation.cljc similarity index 100% rename from src/propeller/variation.clj rename to src/propeller/variation.cljc