diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2021-06-23 18:46:22 +0300 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2021-06-23 18:46:22 +0300 |
| commit | f49835c11b16b0d8cf136f076c31cbc28f1f4931 (patch) | |
| tree | dacf3c29ce3849835e5d4c7f934a7f42a6a0e7c2 | |
| parent | 89229826da0c2b8e019f2f078c2e8de7471e1d7e (diff) | |
refactor library to use new init-macros.fnl feature
Old way of requiring the library:
(local clj (require :fennel-cljlib)
(import-macros cljm :fennel-cljlib.macros)
New way:
(local clj (require :fennel-cljlib)
(import-macros cljm :fennel-cljlib)
| -rw-r--r-- | .fenneldoc | 6 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | init-macros.fnl (renamed from macros.fnl) | 0 | ||||
| -rw-r--r-- | init.fnl | 4 | ||||
| -rw-r--r-- | tests/core.fnl | 2 | ||||
| -rw-r--r-- | tests/fn.fnl | 2 | ||||
| -rw-r--r-- | tests/macros.fnl | 2 |
7 files changed, 9 insertions, 9 deletions
@@ -7,7 +7,7 @@ :project-license "[MIT](https://gitlab.com/andreyorst/fennel-cljlib/-/raw/master/LICENSE)" :project-copyright "Copyright (C) 2020-2021 Andrey Listopadov" :test-requirements {:init.fnl "(import-macros {: assert-eq : assert-ne : assert-is : assert-not} :fennel-test.test)" - :macros.fnl "(require-macros :macros) - (import-macros {: assert-eq} :fennel-test.test) - (local {: eq : vector : hash-map} (require :init))" + :init-macros.fnl "(require-macros :init-macros) + (import-macros {: assert-eq} :fennel-test.test) + (local {: eq : vector : hash-map} (require :init))" :tests/test.fnl "(require-macros :fennel-test.test)"}} @@ -2,7 +2,7 @@ LUA ?= lua FENNEL ?= fennel VERSION ?= $(shell git describe --abbrev=0) FNLSOURCES = init.fnl -FNLMACROS = macros.fnl +FNLMACROS = init-macros.fnl FNLTESTS = $(wildcard tests/*.fnl) LUATESTS = $(FNLTESTS:.fnl=.lua) FNLDOCS = $(FNLMACROS) $(FNLSOURCES) diff --git a/macros.fnl b/init-macros.fnl index 410eca5..410eca5 100644 --- a/macros.fnl +++ b/init-macros.fnl @@ -54,7 +54,7 @@ non-ASCII strings."}) (import-macros {: fn* : into : empty : with-meta : when-let : if-let : when-some : if-some} - (if (and ... (not= ... :init)) (.. ... :.macros) :macros)) + (if (and ... (not= ... :init)) (.. ... :.init-macros) :init-macros)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Utility functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -740,7 +740,7 @@ Map `mul' over two tables: Basic `zipmap' implementation: ``` fennel -(import-macros {: into} :macros) +(import-macros {: into} :init-macros) (fn zipmap [keys vals] (into {} (mapv vector keys vals))) diff --git a/tests/core.fnl b/tests/core.fnl index bac93dd..d759fe4 100644 --- a/tests/core.fnl +++ b/tests/core.fnl @@ -1,4 +1,4 @@ -(require-macros :macros) +(require-macros :init-macros) (require-macros :fennel-test.test) (macro require-module [module] diff --git a/tests/fn.fnl b/tests/fn.fnl index 9b99119..3517918 100644 --- a/tests/fn.fnl +++ b/tests/fn.fnl @@ -1,5 +1,5 @@ (require-macros :fennel-test.test) -(require-macros :macros) +(require-macros :init-macros) (deftest fn* (testing "fn* meta" diff --git a/tests/macros.fnl b/tests/macros.fnl index 2176f15..bef0390 100644 --- a/tests/macros.fnl +++ b/tests/macros.fnl @@ -1,5 +1,5 @@ (require-macros :fennel-test.test) -(require-macros :macros) +(require-macros :init-macros) (deftest into (testing "into" |