summaryrefslogtreecommitdiff
path: root/init.fnl
diff options
context:
space:
mode:
authorAndrey Listopadov <andreyorst@gmail.com>2022-08-26 11:37:48 +0300
committerAndrey Listopadov <andreyorst@gmail.com>2022-08-26 11:37:48 +0300
commit825cd9f936a8890d3ccb1719173af76b9b4e161a (patch)
tree80e1d74fd0ebd73c24b611d511c7c9672b38ac36 /init.fnl
parent4144a9ce6913fb371fd29a24bac96e94690dfbd1 (diff)
proper count for counted collections
Diffstat (limited to 'init.fnl')
-rw-r--r--init.fnl4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.fnl b/init.fnl
index dafba1b..1e87284 100644
--- a/init.fnl
+++ b/init.fnl
@@ -718,7 +718,9 @@ If the sequence is empty, returns nil."
(defn count
"Count amount of elements in the sequence."
[s]
- (lazy.count s))
+ (match (getmetatable s)
+ {:cljlib/type :vector} (length* s)
+ _ (lazy.count s)))
(defn cons
"Construct a cons cell.