Skip to content

Commit

Permalink
Macros do not work
Browse files Browse the repository at this point in the history
  • Loading branch information
lenz committed Dec 29, 2018
1 parent a0b92e7 commit 0440486
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions examples-cljs-planck/toycalc-spec.cljs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
"exec" "plk" "-Sdeps" "{:deps {cli-matic {:mvn/version \"0.2.10\"}}}" "-Ksf" "$0" "$@"
"exec" "plk" "-Sdeps" "{:deps {cli-matic {:mvn/version \"0.2.11\"}}}" "-Ksf" "$0" "$@"

(ns toycalc
(ns toycalc-spec
(:require [cli-matic.core :refer [run-cmd]]
[clojure.spec.alpha :as spec]
[expound.alpha :as expound]
[cljs.pprint :refer [cl-format]]
))

;; To run this, try from the project root:
;; clj -i examples/toycalc-spec.clj -m toycalc add -a 1 -b 80
;; ./toycalc-spec.cljs add -a 1 -b 80

(defn to_base
"Converts a number to a given base"
Expand All @@ -25,8 +25,8 @@


;(expound/def ::SMALL #(< % 100) "should be a small number (<100)")
(spec/def ::ODD-SMALL (spec/and odd? ::SMALL))
(spec/def ::EVEN-SMALL (spec/and even? ::SMALL))
(spec/def ::ODD-SMALL (spec/and odd? ))
(spec/def ::EVEN-SMALL (spec/and even? ))

;(expound/def ::GLOBAL-ADD-VALIDATION
; (fn [{:keys [addendum-1 addendum-2]}]
Expand Down
2 changes: 1 addition & 1 deletion examples-cljs-planck/toycalc.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
"exec" "plk" "-Sdeps" "{:deps {cli-matic {:mvn/version \"0.2.10\"}}}" "-Ksf" "$0" "$@"
"exec" "plk" "-Sdeps" "{:deps {cli-matic {:mvn/version \"0.2.14\"}}}" "-Ksf" "$0" "$@"

(ns toycalc
(:require [cli-matic.core :refer [run-cmd]]
Expand Down
5 changes: 3 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject cli-matic "0.2.10"
(defproject cli-matic "0.2.14"
:description "Compact [sub]command line parsing library, for Clojure"
:url "https://github.com/l3nz/cli-matic"
:license {:name "Eclipse Public License, v2"
Expand All @@ -18,7 +18,8 @@
[jonase/eastwood "0.2.5"]
[lein-kibit "0.1.6"]
[lein-cljfmt "0.5.7"]
[lein-cljsbuild "1.1.7"]]
[lein-cljsbuild "1.1.7"]
[lein-doo "0.1.11"]]
:cljsbuild
{:test-commands {"unit-tests" ["node" "target/unit-tests.js"]}
:builds
Expand Down
2 changes: 1 addition & 1 deletion src/cli_matic/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[clojure.spec.alpha :as s]
[cli-matic.specs :as S]
[cli-matic.help-gen :as H]
[cli-matic.platform :as P :refer [try-catch-all]]
[cli-matic.platform :as P :refer [try-catch-all] :include-macros true]
[cli-matic.utils :as U]
[cli-matic.optionals :as OPT]
[expound.alpha :as expound]
Expand Down
4 changes: 3 additions & 1 deletion src/cli_matic/platform.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@
[f onErr]
`(try (~@f)
(catch :default t#
((~@onErr) t#))))
(do
(prn "E:\n" t# "\n--\n")
((~@onErr) t#)))))

0 comments on commit 0440486

Please sign in to comment.