Created
November 17, 2018 19:52
-
-
Save pbaille/d82f95c3fb9c04f6b998b11d1e542f2f to your computer and use it in GitHub Desktop.
cljs dual names
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
| ;; derived from http://blog.fikesfarm.com/posts/2015-12-12-clojurescript-macro-functions.html | |
| (ns dual-world | |
| #?(:cljs (:require-macros [dual-world :refer [add]]))) | |
| #?(:clj (defmacro add [& xs] `(+ ~@xs 0.1)) | |
| :cljs (defn add [& xs] (apply + xs))) | |
| (add 1 2) | |
| #?(:cljs (apply add 1 2 [])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment