From: Chris Hanson Date: Tue, 1 Mar 1994 21:18:28 +0000 (+0000) Subject: Fix bug in GRAPHICS-TYPE-AVAILABLE? -- this bug is present in the X-Git-Tag: 20090517-FFI~7274 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=71353040dc89365b4797e25cf87c36c2e3866737;p=mit-scheme.git Fix bug in GRAPHICS-TYPE-AVAILABLE? -- this bug is present in the 7.3.0 release and must be fixed there also. --- diff --git a/v7/src/runtime/graphics.scm b/v7/src/runtime/graphics.scm index e5888a52d..c4fc1ff6f 100644 --- a/v7/src/runtime/graphics.scm +++ b/v7/src/runtime/graphics.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: graphics.scm,v 1.10 1994/01/29 21:37:38 adams Exp $ +$Id: graphics.scm,v 1.11 1994/03/01 21:18:28 cph Exp $ -Copyright (c) 1989-91 Massachusetts Institute of Technology +Copyright (c) 1989-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -169,16 +169,20 @@ MIT in each case. |# (if (not entry) (error "Unknown graphics operation" name type)) (cdr entry))))) - - + (define graphics-types '()) ;; alist of ( . ) -(define (graphics-type-available? type-name) - (memq type-name (enumerate-graphics-device-types))) - (define (register-graphics-device-type name type) - (set! graphics-types (cons (cons name type) graphics-types))) + (set! graphics-types (cons (cons name type) graphics-types)) + unspecific) + +(define (graphics-type-available? type-or-name) + (let loop ((types (%enumerate-graphics-device-types))) + (and (not (null? types)) + (or (eq? type-or-name (caar types)) + (eq? type-or-name (cdar types)) + (loop (cdr types)))))) (define (enumerate-graphics-device-types) (map car (%enumerate-graphics-device-types)))