[uim-commit] r1792 - branches/r5rs/scm
kzk at freedesktop.org
kzk at freedesktop.org
Tue Oct 4 02:02:09 PDT 2005
Author: kzk
Date: 2005-10-04 02:02:05 -0700 (Tue, 04 Oct 2005)
New Revision: 1792
Modified:
branches/r5rs/scm/util.scm
Log:
* scm/util.scm
- use "siod" and "srfi-34" feature
- (try-load, try-require): rewrite by using SRFI-34
with-exception-handler
Modified: branches/r5rs/scm/util.scm
===================================================================
--- branches/r5rs/scm/util.scm 2005-10-04 06:18:04 UTC (rev 1791)
+++ branches/r5rs/scm/util.scm 2005-10-04 09:02:05 UTC (rev 1792)
@@ -27,12 +27,16 @@
;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
;;; SUCH DAMAGE.
+
+;;; used features
+(use srif-34)
+(use siod)
+
;;;;
;(require "slib-mulapply.scm")
;(require "slib-srfi-1.scm")
;; Current uim implementation treats char as integer
-
;;
;; generic utilities
;;
@@ -546,21 +550,19 @@
;; returns succeeded or not
(define try-load
(lambda (file)
- (load file)))
-; (lambda (file)
-; (and (file-readable? (make-scm-pathname file))
-; (not (*catch 'errobj (begin (load file)
-; #f))))))
+ (with-exception-handler
+ (lambda (err) #f)
+ (lambda ()
+ (load file)))))
;; TODO: write test
;; returns succeeded or not
(define try-require
(lambda (file)
- (require file)))
-; (lambda (file)
-; (and (file-readable? (make-scm-pathname file))
-; (eq? (symbolconc '* (string->symbol file) '-loaded*)
-; (*catch 'errobj (require file))))))
+ (with-exception-handler
+ (lambda (err) #f)
+ (lambda ()
+ (require file)))))
;; used for dynamic environment substitution of closure
(define %%enclose-another-env
More information about the uim-commit
mailing list