I have defined a function which takes a map. I thought to use destructuring to access the values. However, I also want to check whether there are any used keys.
So, for example something like...
(defun func1 [{:keys [a b c] :rest rest}]
(println a b c)
(println rest))
(func1 {:a 1 :b 2 :c 3 :d 4})
which would print
1 2 3
4
The reason that I want this is that if rest is not null, this is probably an error, which I'd like to signal. I know about :as, which I could use. But then I need to store the list of valid keys twice.
Am I missing something?
Phil