[uim-commit] r922 - trunk/scm

tkng at freedesktop.org tkng at freedesktop.org
Sat Jul 2 21:39:11 PDT 2005


Author: tkng
Date: 2005-07-02 21:39:08 -0700 (Sat, 02 Jul 2005)
New Revision: 922

Modified:
   trunk/scm/util.scm
Log:
* scm/util.scm:
 - (define-record): Added null check to getter/setter.


Modified: trunk/scm/util.scm
===================================================================
--- trunk/scm/util.scm	2005-07-03 04:21:44 UTC (rev 921)
+++ trunk/scm/util.scm	2005-07-03 04:39:08 UTC (rev 922)
@@ -504,12 +504,18 @@
 			 (default  (nth 1 spec))
 			 (getter-sym (symbolconc rec-sym '- elem-sym))
 			 (getter (lambda (rec)
-				   (nth index rec)))
+				   (if rec
+				       (nth index rec)
+				       (begin ;; This error message is not need?
+					 (print (string-append "Error in " getter-sym))
+					 #f))))
 			 (setter-sym (symbolconc rec-sym '-set- elem-sym '!))
 			 (setter (lambda (rec val)
-				   (set-car!
-				    (nthcdr index rec)
-				    val))))
+				   (if rec
+				       (set-car! (nthcdr index rec) val)
+				       ;; This error message is not need?
+				       (print (string-append "Error in " setter-sym))
+				       #f))))
 		    (eval (list 'define getter-sym getter)
 			  toplevel-env)
 		    (eval (list 'define setter-sym setter)



More information about the uim-commit mailing list