X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/9523c079183ecaa05c81130d5d80d792211ed695..691d6718b76e5a6623b3277d5b37db4722569f29:/glib/gutils.lisp diff --git a/glib/gutils.lisp b/glib/gutils.lisp index 5d6e649..33f85b7 100644 --- a/glib/gutils.lisp +++ b/glib/gutils.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gutils.lisp,v 1.4 2001-04-29 20:01:54 espen Exp $ +;; $Id: gutils.lisp,v 1.8 2001-05-29 15:40:38 espen Exp $ (in-package "KERNEL") @@ -33,7 +33,6 @@ (in-package "GLIB") - (defun type-expand-to (type form) (labels ((expand (form0) (if (eq (first (mklist form0)) type) @@ -50,7 +49,7 @@ `(progn (let ((,gc-inhibit lisp::*gc-inhibit*)) (ext:gc-off) - (unwind-protect + (unwind-protect ,@body (unless ,gc-inhibit (ext:gc-on))))))) @@ -112,6 +111,11 @@ (fdefinition object) object)) +(defun intersection-p (list1 list2 &key (test #'eq)) + (dolist (obj list1 nil) + (when (member obj list2 :test test) + (return-from intersection-p t)))) + (defun split-string (string delimiter) (declare (simple-string string) (character delimiter)) @@ -142,4 +146,9 @@ 'string (first strings) (if delimiter (string delimiter) "") - (concatenate-strings (rest strings))))) + (concatenate-strings (rest strings) delimiter)))) + +(defun string-prefix-p (prefix string) + (and + (>= (length string) (length prefix)) + (string= prefix string :end2 (length prefix))))