Created
June 24, 2016 15:30
-
-
Save Jannis/0e6d68d192898c176223d0cc726a3af7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (ns workflo.macros.command | |
| (:require [clojure.spec :as s] | |
| [clojure.spec.gen :as gen])) | |
| (s/def ::command-name | |
| symbol?) | |
| (s/def ::command-description | |
| string?) | |
| (s/def ::command-query | |
| ::s/any) | |
| (s/def ::command-data-spec | |
| (s/with-gen | |
| s/spec? | |
| #(s/gen #{(s/spec symbol?) | |
| (s/spec map?)}))) | |
| (s/def ::command-inputs | |
| (s/tuple (s/? ::command-query) ::command-data-spec)) | |
| (s/def ::command-form | |
| seq?) | |
| (s/def ::command-implementation | |
| seq?) | |
| (s/fdef defcommand | |
| :args (s/cat :name ::command-name | |
| ;; :description (s/? ::command-description) | |
| ;; :inputs ::command-inputs | |
| ;; :forms (s/* ::command-form) | |
| ;; :implementation ::command-implementation | |
| ) | |
| :ret ::s/any) | |
| (defmacro defcommand | |
| [name & forms] | |
| (println "NAME" name) | |
| (println "FORMS" forms)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment