chore: remote-tracking branch 'gh/master'

This commit is contained in:
Edward Langley
2025-06-28 15:02:08 -07:00
3 changed files with 13 additions and 6 deletions

View File

@ -17,9 +17,9 @@
(data-lens.transducers:transducer-lambda
((acc next)
(fset:with acc next))))
(defmethod data-lens:functionalize ((it fset:set))
(lambda (key)
(nth-value 1 (fset:lookup it key))))
(defmethod data-lens:functionalize ((set fset:set))
(lambda (it)
(fset:contains? set it)))
(defmethod data-lens:extract-key ((it fset:set) key)
(nth-value 1 (fset:lookup it key)))
(defun make-set-lens (item)
@ -114,3 +114,4 @@
(funcall (funcall (make-set-lens loc)
cb)
rec))

View File

@ -222,10 +222,14 @@ contain the new value at the location focused by the lens."
(:method ((rec hash-table) cb loc)
(funcall (funcall (make-hash-table-lens loc)
cb)
rec))
(:method ((rec vector) cb loc)
(funcall (funcall (make-list-lens loc)
cb)
rec)))
(defun lens (loc)
"A lens for updating a hash-table, discarding previous values"
"extensible lens using a multimethod for internal implementation"
(lambda (cb)
(lambda (rec)
(generic-lens rec cb loc))))

View File

@ -56,8 +56,10 @@
CONSTRAINT: SEQ should be copied, not modified"))
(declaim (inline exit-early))
(defun exit-early (acc)
(throw 'done acc))
(declaim (notinline exit-early))
(defun transduce (xf build seq)
(let* ((xf (etypecase xf