-
Notifications
You must be signed in to change notification settings - Fork 32
Description
The definition of destructuring-pair?
looks like it is missing something in the second clause:
(defn- pair? [x] (and (vector? x) (= 2 (core/count x))))
(defn- destructuring-pair? [x]
(and (pair? x) (not (or (keyword? x) (= '& x)))))
[Lines 30-32 in current version.]
If pair? x
is true, then x
is certainly not a keyword or a symbol, so the second clause is automatically true, obviating the need for the function. Should the second clause be replaced with (not (some #(or (keyword? %) (= '& %)) x))
, or perhaps (not (or (some keyword? x) (= '& (first x))))
if preferred for your intent?
Metadata
Metadata
Assignees
Labels
No labels