Simplify frequencies implementation (#1793)

* Add tests for frequencies

* Simplify frequencies implementation

---------

Co-authored-by: sogaiu <983021772@users.noreply.github.com>
This commit is contained in:
sogaiu
2026-08-08 09:30:20 -05:00
committed by GitHub
co-authored by sogaiu
parent f362e8f0fa
commit 331e8544bc
2 changed files with 9 additions and 2 deletions
+1 -2
View File
@@ -1764,8 +1764,7 @@
[ind]
(def freqs @{})
(each x ind
(def n (in freqs x))
(set (freqs x) (if n (+ 1 n) 1)))
(put freqs x (inc (in freqs x 0))))
freqs)
(defn group-by