Last active
February 24, 2018 15:22
-
-
Save mfikes/d296af1c7621d69c5b1db9323763a6ca to your computer and use it in GitHub Desktop.
Macro indirectly using ClojureScript library clojure.zip
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 my.consumer | |
(:require [my.foo :refer [abc abc2]])) | |
(defn do-something [] | |
(abc [[1 2 3] [4 [5 6] 7] [8 9]])) | |
(defn do-something2 [] | |
(abc2 [[1 2 3] [4 [5 6] 7] [8 9]])) |
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 my.foo) | |
(defmacro abc [z] | |
`(make-zipper ~z)) | |
(defmacro abc2 [z] | |
`(clojure.zip/zipper vector seq (fn [_# c#] c#) ~z)) |
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 my.foo | |
(:require-macros my.foo) | |
(:require [clojure.zip :as z])) | |
(defn make-zipper [z] | |
(z/zipper vector? seq (fn [_ c] c) z)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment