From: Matt Birkholz Date: Mon, 12 Mar 2018 16:12:48 +0000 (-0700) Subject: glib: Add guarantee-color. X-Git-Tag: mit-scheme-pucked-x11-0.2.2~50 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7c7a78898a662a7d9936eaf1cd36289576cbe2e3;p=mit-scheme.git glib: Add guarantee-color. --- diff --git a/src/glib/glib.scm b/src/glib/glib.scm index 252fa0580..1fbdd0b9f 100644 --- a/src/glib/glib.scm +++ b/src/glib/glib.scm @@ -114,6 +114,11 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (set-color-blue! color blue) (set-color-alpha! color alpha) color)) + +(define (guarantee-color object operator) + (if (color? object) + object + (error:wrong-type-argument object "a color" operator))) ;;; GLib Mutex