From 4ae4c1e06962cf3a00d71837279e71e738c45313 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 24 Oct 2020 11:24:04 +0300 Subject: remove limitation of different length with nils in arglist --- macros/core.fnl | 4 ++-- macros/fn.fnl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'macros') diff --git a/macros/core.fnl b/macros/core.fnl index 9b01b70..b47f38b 100644 --- a/macros/core.fnl +++ b/macros/core.fnl @@ -8,7 +8,7 @@ (fn* if-let ([bindings then] - (if-let bindings then 'nil)) + (if-let bindings then nil)) ([bindings then else] (check-bindings bindings) (let [[form test] bindings] @@ -29,7 +29,7 @@ (fn* if-some ([bindings then] - (if-some bindings then 'nil)) + (if-some bindings then nil)) ([bindings then else] (check-bindings bindings) (let [[form test] bindings] diff --git a/macros/fn.fnl b/macros/fn.fnl index 7a3b027..cada324 100644 --- a/macros/fn.fnl +++ b/macros/fn.fnl @@ -74,7 +74,7 @@ ;; For more info check `gen-arity' documentation. (let [[args & body] args (arity body amp) (gen-arity [args (_unpack body)])] - `(let [len# (length [...])] + `(let [len# (select :# ...)] ,(arity-dispatcher 'len# (if amp {} {arity body}) @@ -94,7 +94,7 @@ (assert-compile (<= (length bodies&) 1) "fn* must have only one arity with `&':" (. bodies& (length bodies&))) - `(let [len# (length [...])] + `(let [len# (select :# ...)] ,(arity-dispatcher 'len# bodies -- cgit v1.2.3