From 825cd9f936a8890d3ccb1719173af76b9b4e161a Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Fri, 26 Aug 2022 11:37:48 +0300 Subject: proper count for counted collections --- init.fnl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3