Plaster
New
List
Login
text
default
anonymous
2021.12.08 19:10:18
(defun string-ior (&rest strings) (remove-duplicates (apply #'u:s+ strings))) (defun string-xor (&rest strings) (apply #'u:s+ (loop :with all := (apply #'u:s+ strings) :with unique := (remove-duplicates all) :for char :across unique :when (= 1 (count char all)) :collect char))) (defun string-and (&rest strings) (apply #'u:s+ (loop :with length := (length strings) :with all := (apply #'u:s+ strings) :with unique := (remove-duplicates all) :for char :across unique :when (= length (count char all)) :collect char))) (let ((charset "")) (defun string-set-charset (string) (setf charset string)) (defun string-charset () charset) (defun string-not (string &optional (range charset)) (loop :with result := (copy-seq range) :for char :across string :do (setf result (remove char result)) :finally (return result))) (defun string-nand (&rest strings) (string-not (apply #'string-and strings))) (defun string-nor (&rest strings) (string-not (apply #'string-ior strings))) (defun string-eqv (&rest strings) (string-not (apply #'string-xor strings))) (defun string-andc1 (str1 str2) (string-and (string-not str1) str2)) (defun string-andc2 (str1 str2) (string-and str1 (string-not str2))) (defun string-orc1 (str1 str2) (string-ior (string-not str1) str2)) (defun string-orc2 (str1 str2) (string-ior str1 (string-not str2))))
Raw
Annotate
Repaste
Edit