Skip to content

Commit

Permalink
Refactoring, renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
kongra committed Feb 26, 2019
1 parent d3fd530 commit c2f4dc0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
File renamed without changes.
2 changes: 0 additions & 2 deletions clojure-build.sh

This file was deleted.

File renamed without changes.
30 changes: 12 additions & 18 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,46 +1,40 @@
;; Copyright (c) Konrad Grzanek
;; Created 2016-10-05
(defproject kongra/ch "0.1.15"
(defproject kongra/ch "0.1.16"
:description "Low-cost dynamic type and constraints checks"
:url "http://github.com/kongra/ch"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}

:dependencies [[org.clojure/clojure "1.10.0"]
[primitive-math "0.1.6"]
[org.clojure/clojurescript "1.10.439"
:exclusions [com.google.errorprone/error_prone_annotations
com.google.code.findbugs/jsr305]]]
[org.clojure/clojurescript "1.10.520"]]

:plugins [[lein-cljsbuild "1.1.7"]]

:aot :all
:source-paths ["src/main/clojure" "src/main/clojure-script"]
:test-paths ["test/clojure"]

:global-vars {*warn-on-reflection* true
*print-length* 500}
:global-vars {*warn-on-reflection* false
*print-length* 500}

:pedantic? :warn
;; :pedantic? :warn

:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]

:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"]

:aliases {"fig:repl" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]}

:profiles {:repl {:dependencies [[org.clojure/tools.nrepl "0.2.13"]]
:plugins [[lein-nodisassemble "0.1.3" ]
[cider/cider-nrepl "0.19.0"
:exclusions [org.clojure/tools.cli
org.clojure/tools.namespace
rewrite-clj]]]}
:profiles {:repl {:plugins [[lein-nodisassemble "0.1.3"]
[cider/cider-nrepl "0.21.0"]]

:dev {:dependencies [[com.bhauman/figwheel-main "0.2.0"
:exclusions [commons-codec args4j]]
:middleware [lein-nodisassemble.plugin/middleware
cider-nrepl.plugin/middleware]}

[com.bhauman/rebel-readline-cljs "0.1.4"
:exclusions [args4j]]]
:dev {:dependencies [[com.bhauman/figwheel-main "0.2.0"]
[com.bhauman/rebel-readline-cljs "0.1.4"]]

:source-paths ["src/main/clojure-script"]
:resource-paths ["target"]}}
Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure-script/cljs/kongra/ch.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
(chReg chNonBlank)

;; ADTs CH(ECK)S
(defn chMaybe [check x] (if (nil? x) x (check x)))
(defn chOptional [check x] (if (nil? x) x (check x)))

;; REGISTRY QUERYING
(defn asPred
Expand Down
1 change: 1 addition & 0 deletions src/main/clojure/cljs/kongra/ch/macros.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
;; Copyright (c) Konrad Grzanek
;; Created 2018-08-27
(ns cljs.kongra.ch.macros)
(set! *warn-on-reflection* true)

(defmacro chP
[expr]
Expand Down
4 changes: 3 additions & 1 deletion src/main/clojure/clojure/kongra/ch.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

[primitive-math :as p]))

(set! *warn-on-reflection* true)

;; CH(ECK)S
(defn errMessage
[x]
Expand Down Expand Up @@ -53,7 +55,7 @@
:style/indent [0])]
`(def ~name (chC ~expr))))

(defn chMaybe [check x] (if (nil? x) x (check x)))
(defn chOptional [check x] (if (nil? x) x (check x)))

(defchP chUnit (nil? x))
(defchP chSome (some? x))
Expand Down

0 comments on commit c2f4dc0

Please sign in to comment.