summaryrefslogtreecommitdiff
path: root/cljlib.fnl
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2020-11-12 19:25:57 +0300
committerAndrey Orst <andreyorst@gmail.com>2020-11-12 19:25:57 +0300
commita1851986383148593ca85675d3dafd1e8517481a (patch)
treea99dbf637b2f5fb6f1465695eee71a9d008fd80e /cljlib.fnl
parent32f268f51538bd4c26d9da337e01d3df39ea2f2e (diff)
fix(CI): overhaul
Diffstat (limited to 'cljlib.fnl')
-rw-r--r--cljlib.fnl12
1 files changed, 4 insertions, 8 deletions
diff --git a/cljlib.fnl b/cljlib.fnl
index 14b5869..f0b4d18 100644
--- a/cljlib.fnl
+++ b/cljlib.fnl
@@ -213,15 +213,11 @@ If `tbl' is sequential table, returns its shallow copy."
([tbl x & xs]
(apply conj (conj tbl x) xs)))
-(fn* consj
+(fn consj [...]
"Like conj but joins at the front. Modifies `tbl'."
- ([] (empty []))
- ([tbl] tbl)
- ([tbl x]
- (when-some [x x]
- (doto tbl (insert 1 x))))
- ([tbl x & xs]
- (apply consj (consj tbl x) xs)))
+ (let [[tbl x & xs] [...]]
+ (if (nil? x) tbl
+ (consj (doto tbl (insert 1 x)) (unpack xs)))))
(fn& core.cons
"Insert `x' to `tbl' at the front. Modifies `tbl'."