Created
January 31, 2019 22:08
-
-
Save drewc/250c558bcf0041c5e43fbc3297893ae8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun sequence-right-trim (thing sequence) | |
(let ((last (elt sequence (- (length sequence) 1)))) | |
(if (equalp thing last) | |
(subseq sequence 0 (1+ (position-if-not (lambda (c) (equalp c thing)) sequence :from-end t))) | |
sequence))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment