Why Nostr? What is Njump?
2024-12-28 09:08:29

Digital Mark λ 📚 🕹 💾 🥃 on Nostr: Every goddamned time I have to write #'foo and funcall, I am sure COMMON LISPers do ...

Every goddamned time I have to write #'foo and funcall, I am sure COMMON LISPers do not understand the word "fun".

;; Test whether 'haystack' ends with 'needle'. :ci case-insensitive
(defun string-has-suffixp (haystack needle &key ((:ci ci) NIL))
(let* ( (test (if ci #'string-equal #'string=))
(hlen (length haystack)) (nlen (length needle))
)
(and (> hlen 0)
(> nlen 0)
(<= nlen hlen)
(funcall test haystack needle :start1 (- hlen nlen) :end1 hlen)
)))
#lisp
Author Public Key
npub1lwr6ewhchfc8u4k0fupgl4kvr6vm3fu0aqe8e2msj9032ccmqeeqmu38zw