From: Chris Hanson Date: Sun, 3 Jun 2001 01:42:40 +0000 (+0000) Subject: Change CLOSE-RESOURCE so that second argument is required rather than X-Git-Tag: 20090517-FFI~2735 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=caa3d7c0a0846809c894aec27e87607058215029;p=mit-scheme.git Change CLOSE-RESOURCE so that second argument is required rather than optional. --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index e6594a672..03d9d6b02 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-core.scm,v 1.141 2001/06/03 01:22:31 cph Exp $ +;;; $Id: imail-core.scm,v 1.142 2001/06/03 01:42:28 cph Exp $ ;;; ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology ;;; @@ -465,19 +465,20 @@ (define (open-resource url) (or (get-memoized-resource url) - (memoize-resource (%open-resource url) close-resource))) + (memoize-resource (%open-resource url) + (lambda (resource) (close-resource resource #t))))) (define-generic %open-resource (url)) ;; ------------------------------------------------------------------- -;; Close RESOURCE, freeing up connections, memory, etc. Subsequent use -;; of the resource must work, but may incur a significant time or space -;; penalty. Optional argument NO-DEFER? means that the resource must -;; be closed immediately, and not deferred. +;; Close RESOURCE, freeing up connections, memory, etc. Subsequent +;; use of the resource must work, but may incur a significant time or +;; space penalty. NO-DEFER? means that the resource must be closed +;; immediately, and not deferred. -(define (close-resource resource #!optional no-defer?) +(define (close-resource resource no-defer?) (save-resource resource) - (%close-resource resource (if (default-object? no-defer?) #f no-defer?))) + (%close-resource resource no-defer?)) (define-generic %close-resource (resource no-defer?)) diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 025c07845..923b5e35d 100644 --- a/v7/src/imail/imail-file.scm +++ b/v7/src/imail/imail-file.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-file.scm,v 1.76 2001/06/03 01:22:54 cph Exp $ +;;; $Id: imail-file.scm,v 1.77 2001/06/03 01:42:31 cph Exp $ ;;; ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology ;;; @@ -459,7 +459,7 @@ (call-with-input-xstring (file-folder-xstring folder) 0 reader))))) (define-method discard-folder-cache ((folder )) - (close-resource folder)) + (close-resource folder #f)) (define-method probe-folder ((folder )) folder diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 042df648b..23723eea6 100644 --- a/v7/src/imail/imail-imap.scm +++ b/v7/src/imail/imail-imap.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-imap.scm,v 1.177 2001/06/03 01:39:30 cph Exp $ +;;; $Id: imail-imap.scm,v 1.178 2001/06/03 01:42:40 cph Exp $ ;;; ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology ;;; @@ -1535,7 +1535,7 @@ #f) (define-method discard-folder-cache ((folder )) - (close-resource folder) + (close-resource folder #f) (reset-imap-folder! folder)) (define-method probe-folder ((folder )) @@ -1549,7 +1549,7 @@ 'OFFLINE)) (define-method disconnect-folder ((folder )) - (close-resource folder)) + (close-resource folder #f)) (define-method folder-supports-mime? ((folder )) folder