Skip to content

Commit b035426

Browse files
committed
Support optional-lens in clause-lens.
1 parent 7153649 commit b035426

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/active/clojure/match.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@
227227
(path-matches-clause? clause) path-matches-lens
228228
(key-exists-clause? clause) key-exists-lens
229229
(path-exists-clause? clause) path-exists-lens
230+
(optional-clause? clause) (lens/>> optional-clause-clause ((clause-lens key-matches-lens path-matches-lens key-exists-lens path-exists-lens)
231+
(optional-clause-clause clause)))
230232
:else
231233
(c/assertion-violation `clause-lens "not a valid clause" clause))))
232234

@@ -248,7 +250,7 @@
248250

249251
(def path-lens
250252
"Returns a function that when applied to a clause, returns a lens focusing on
251-
the matcher of the clause."
253+
the path of the clause."
252254
(clause-lens key-matches-clause-key
253255
path-matches-clause-path
254256
key-exists-clause-key

0 commit comments

Comments
 (0)