-
-
Save thheller/405951452cf872eb16ba2d4e1fb5a117 to your computer and use it in GitHub Desktop.
Exploring if I can get Respo component simpler. Tried in Lumo.
This file contains 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 demo.a | |
(:require [demo.b :refer [defcomp]])) | |
(defcomp my-comp [x y] 1) | |
(println my-comp) |
This file contains 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 demo.b) | |
(defmacro defcomp [comp-name params body] | |
`(def ~comp-name | |
(demo.b/create-comp ~(keyword comp-name) | |
(~'fn [~@params] | |
(~'fn [~'cursor] ~body))))) |
This file contains 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 demo.b | |
(:require-macros [demo.b])) | |
(defn create-comp [comp-name body] | |
[comp-name body]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment