summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2020-10-25 20:45:42 +0300
committerAndrey Orst <andreyorst@gmail.com>2020-10-25 20:45:42 +0300
commitf696a71b13d6867bf7168e6314eeaa8663b30e92 (patch)
tree3a3793653babbab24a413a374366c84bcf3bc0e3 /macros
parent7f6c6a600ec8652bf64d4b343c8d920d71d464c2 (diff)
feature: refactoring
Diffstat (limited to 'macros')
-rw-r--r--macros/core.fnl6
-rw-r--r--macros/fn.fnl6
2 files changed, 6 insertions, 6 deletions
diff --git a/macros/core.fnl b/macros/core.fnl
index a53eced..bf4dfe8 100644
--- a/macros/core.fnl
+++ b/macros/core.fnl
@@ -1,5 +1,5 @@
(import-macros {: fn*} :macros.fn)
-(local _unpack (or table.unpack unpack))
+(local unpack (or table.unpack _G.unpack))
(local insert table.insert)
(fn check-bindings [bindings]
@@ -25,7 +25,7 @@
`(let [tmp# ,test]
(if tmp#
(let [,form tmp#]
- ,(_unpack body))))))
+ ,(unpack body))))))
(fn* if-some
([bindings then]
@@ -47,7 +47,7 @@
(if (= tmp# nil)
nil
(let [,form tmp#]
- ,(_unpack body))))))
+ ,(unpack body))))))
(fn table-type [tbl]
diff --git a/macros/fn.fnl b/macros/fn.fnl
index cada324..cdd3636 100644
--- a/macros/fn.fnl
+++ b/macros/fn.fnl
@@ -1,4 +1,4 @@
-(local _unpack (or table.unpack unpack))
+(local unpack (or table.unpack _G.unpack))
(local insert table.insert)
(fn string? [x]
@@ -28,7 +28,7 @@
* Try adding function parameters as a list of identifiers in brackets." args)
(values (length args)
- (list 'let [args ['...]] (list 'do (_unpack body)))
+ (list 'let [args ['...]] (list 'do (unpack body)))
(has-amp? args)))
(fn arity-dispatcher [len fixed body& name]
@@ -73,7 +73,7 @@
;; Produces arglist and body for single-arity function.
;; For more info check `gen-arity' documentation.
(let [[args & body] args
- (arity body amp) (gen-arity [args (_unpack body)])]
+ (arity body amp) (gen-arity [args (unpack body)])]
`(let [len# (select :# ...)]
,(arity-dispatcher
'len#