Skip to content

Instantly share code, notes, and snippets.

View oantolin's full-sized avatar

Omar Antolín Camarena oantolin

View GitHub Profile
@oantolin
oantolin / consumptive-components.el
Created April 1, 2023 21:03
Component separator for orderless which makes patterns consume their match
(defun partition (pred list)
"Split LIST into elements for which PRED returns true and false."
(let (true false)
(dolist (elt list)
(if (funcall pred elt)
(push elt true)
(push elt false)))
(cons (nreverse true) (nreverse false))))
(defun connected-components (vertices adjacentp)