feat(utils): add SUFFIXP to test that a sequence has a suffix

This commit is contained in:
Edward
2020-12-30 22:07:09 -08:00
parent 07b0c02806
commit cf67a11e13

View File

@ -151,6 +151,15 @@
(define-modify-macro updatef (fun &rest args) (define-modify-macro updatef (fun &rest args)
update) update)
(defun-ct suffixp (suffix &key (test 'eql test-p))
(lambda (it)
(if test-p
(alexandria:ends-with-subseq suffix
it
:test test)
(alexandria:ends-with-subseq suffix
it))))
(defun-ct transform-head (fun) (defun-ct transform-head (fun)
(lambda (it) (lambda (it)
(typecase it (typecase it