[uim-commit] r1415 - in branches/r5rs: doc scm test

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Sep 4 13:43:38 PDT 2005


Author: yamaken
Date: 2005-09-04 13:43:36 -0700 (Sun, 04 Sep 2005)
New Revision: 1415

Modified:
   branches/r5rs/doc/COMPATIBILITY
   branches/r5rs/scm/custom-rt.scm
   branches/r5rs/scm/custom.scm
   branches/r5rs/scm/hangul.scm
   branches/r5rs/scm/im-custom.scm
   branches/r5rs/scm/key.scm
   branches/r5rs/scm/util.scm
   branches/r5rs/test/test-util.scm
Log:
* doc/COMPATIBILITY
* test/test-util.scm
* scm/custom.scm
* scm/util.scm
* scm/im-custom.scm
* scm/hangul.scm
* scm/key.scm
* scm/custom-rt.scm
  - Port r1413 from trunk


Modified: branches/r5rs/doc/COMPATIBILITY
===================================================================
--- branches/r5rs/doc/COMPATIBILITY	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/doc/COMPATIBILITY	2005-09-04 20:43:36 UTC (rev 1415)
@@ -58,6 +58,25 @@
 The changes are described below in most recently updated order.
 
 ------------------------------------------------------------------------------
+Summary: Obsolete some misc Scheme APIs
+Affects: IM developers
+Updates: Scheme API
+Version: 0.5, 0.4.9
+Revision: ac1413
+Date: 2005-09-05
+Modifier: YamaKen
+Related:
+URL:
+Changes:
+  (removed) bitwise-or
+      (new) bitwise-ior
+  (removed) enclose-another-env
+      (new) %%enclose-another-env
+  (removed) toplevel-env
+      (new) interaction-environment
+Description:
+  Obsolete inappropriate or wrong API with new appropriate ones.
+------------------------------------------------------------------------------
 Summary: An experimental custom variable reloading API
 Affects: Helper program developers, Bridge developers
 Updates: C API, Helper protocol

Modified: branches/r5rs/scm/custom-rt.scm
===================================================================
--- branches/r5rs/scm/custom-rt.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/custom-rt.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -203,7 +203,7 @@
 	   (let ((key-val (custom-modify-key-predicate-names val)))
 	     (eval (list 'define (symbolconc sym '?)
 			 (list 'make-key-predicate (list 'quote key-val)))
-		   toplevel-env))
+		   (interaction-environment)))
 	   #t)
 	  ((custom-exist? sym #f)
 	   (set-symbol-value! sym val)
@@ -226,7 +226,7 @@
 				    (list 'quote default)
 				    default)))
 	    (eval (list 'define sym quoted-default)
-		  toplevel-env)
+		  (interaction-environment))
 	    (if (custom-key-exist? sym)
 		;; already define-key'ed in ~/.uim
 		(custom-call-hook-procs sym custom-set-hooks)
@@ -234,7 +234,7 @@
 		  (if (eq? (car type)
 			   'key)
 		      (eval (list 'define (symbolconc sym '?) list)
-			    toplevel-env))
+			    (interaction-environment)))
 		  (custom-set-value! sym default))))))))  ;; to apply hooks
 
 ;; lightweight implementation

Modified: branches/r5rs/scm/custom.scm
===================================================================
--- branches/r5rs/scm/custom.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/custom.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -511,7 +511,7 @@
 				    (list 'quote default)
 				    default)))
 	    (eval (list 'define sym quoted-default)
-		  toplevel-env)
+		  (interaction-environment))
 	    (custom-set-value! sym default)))  ;; to apply hooks
       (for-each (lambda (subgrp)
 		  (let ((registered (custom-group-subgroups primary-grp)))
@@ -564,7 +564,7 @@
 	       (let ((key-val (custom-modify-key-predicate-names val)))
 		 (eval (list 'define (symbolconc sym '?)
 			     (list 'make-key-predicate (list 'quote key-val)))
-		       toplevel-env)))
+		       (interaction-environment))))
 	   (custom-call-hook-procs sym custom-set-hooks)
 	   (custom-call-hook-procs sym custom-update-hooks)
 	   (let ((post-activities (map-activities)))

Modified: branches/r5rs/scm/hangul.scm
===================================================================
--- branches/r5rs/scm/hangul.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/hangul.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -40,8 +40,8 @@
 	 (generic-commit-key?
 	  (make-key-predicate '(" " generic-return-key?)))
 	 (generic-proc-input-state-with-preedit-with-this-env
-	  (enclose-another-env generic-proc-input-state-with-preedit
-	  		       (the-environment))))
+	  (%%enclose-another-env generic-proc-input-state-with-preedit
+				 (the-environment))))
     (lambda (gc key state rkc)  ;; "gc" stands for "generic-context"
       (generic-proc-input-state-with-preedit-with-this-env gc key state rkc))))
 
@@ -54,7 +54,7 @@
 	 (generic-proc-input-state-with-preedit
 	  hangul-proc-on-mode-with-preedit)
 	 (generic-proc-input-state-with-this-env
-	  (enclose-another-env generic-proc-input-state (the-environment))))
+	  (%%enclose-another-env generic-proc-input-state (the-environment))))
     (lambda (gc key state)  ;; "gc" stands for "generic-context"
       (generic-proc-input-state-with-this-env gc key state))))
 
@@ -62,7 +62,7 @@
 (define hangul-key-press-handler
   (let* ((generic-proc-input-state hangul-proc-on-mode)
 	 (generic-key-press-handler-with-this-env
-	  (enclose-another-env generic-key-press-handler (the-environment))))
+	  (%%enclose-another-env generic-key-press-handler (the-environment))))
     (lambda (gc key state)
       (generic-key-press-handler-with-this-env gc key state))))
 

Modified: branches/r5rs/scm/im-custom.scm
===================================================================
--- branches/r5rs/scm/im-custom.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/im-custom.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -197,9 +197,9 @@
 		  loaded-sym)
 		 ((try-load file)
 		  (eval (list 'define loaded-sym #t)
-			toplevel-env)
+			(interaction-environment))
 		  (eval (list 'define reloaded-sym #t)
-			toplevel-env)
+			(interaction-environment))
 		  loaded-sym)
 		 (else
 		  #f)))))

Modified: branches/r5rs/scm/key.scm
===================================================================
--- branches/r5rs/scm/key.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/key.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -307,7 +307,7 @@
     (let* ((modified-key-strs (modify-key-strs-implicitly key-strs))
 	   (predicate (make-key-predicate modified-key-strs)))
       (eval (list 'define key-predicate-sym predicate)
-	    toplevel-env))))
+	    (interaction-environment)))))
 
 (define valid-key-str?
   (lambda (key-str)

Modified: branches/r5rs/scm/util.scm
===================================================================
--- branches/r5rs/scm/util.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/scm/util.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -535,7 +535,7 @@
 (define bitwise-and
   (lambda xs
     (fold bit-and (bitwise-not 0) xs)))
-(define bitwise-or
+(define bitwise-ior
   (lambda xs
     (fold bit-or 0 xs)))
 (define bitwise-xor
@@ -576,11 +576,8 @@
 ;	 (eq? (symbolconc '* (string->symbol file) '-loaded*)
 ;	      (*catch 'errobj (require file))))))
 
-;; for eval
-(define toplevel-env ())
-
 ;; used for dynamic environment substitution of closure
-(define enclose-another-env
+(define %%enclose-another-env
   (lambda (closure another-env)
     (let* ((code (%%closure-code closure))
 	   (args (car code))
@@ -604,9 +601,9 @@
 				 (set-car! (nthcdr index rec)
 					   val))))
 		  (eval (list 'define getter-sym getter)
-			toplevel-env)
+			(interaction-environment))
 		  (eval (list 'define setter-sym setter)
-			toplevel-env)))
+			(interaction-environment))))
 	      rec-spec
 	      (iota (length rec-spec)))
     (let ((creator-sym (symbolconc rec-sym '-new))
@@ -630,7 +627,7 @@
 			(else
 			 #f))))))
       (eval (list 'define creator-sym creator)
-	    toplevel-env))))
+	    (interaction-environment)))))
 
 ;; for direct candidate selection
 (define number->candidate-index

Modified: branches/r5rs/test/test-util.scm
===================================================================
--- branches/r5rs/test/test-util.scm	2005-09-04 20:35:59 UTC (rev 1414)
+++ branches/r5rs/test/test-util.scm	2005-09-04 20:43:36 UTC (rev 1415)
@@ -29,7 +29,7 @@
 ;;; SUCH DAMAGE.
 ;;;;
 
-;; This file is tested with revision 952 (new repository)
+;; This file is tested with revision 1413 (new repository)
 
 (use test.unit)
 
@@ -1315,10 +1315,17 @@
 		 (uim '(alist-delete 'three alist-sym eq?)))))
 
 (define-uim-test-case "test util Siod specific procedures"
-  ("test toplevel-env"
-   (assert-true (uim-bool '(eval '(symbol-bound? 'filter-map)
-				 toplevel-env))))
-  ("test enclose-another-env"
+  ("test interaction-environment"
+   (assert-true  (uim-bool '(eval '(symbol-bound? 'filter-map)
+				  (interaction-environment))))
+   (assert-false (uim-bool '(eval '(symbol-bound? 'filter-baz)
+				  (interaction-environment))))
+   (uim '(eval (list define 'filter-baz filter-map)
+	       (interaction-environment)))
+   (assert-true  (uim-bool '(eval '(symbol-bound? 'filter-baz)
+				  (interaction-environment))))
+   (assert-true  (uim-bool '(eq? filter-baz filter-map))))
+  ("test %%enclose-another-env"
    (assert-equal 3
 		 (uim '(let* ((x 1)
 			      (y 2)
@@ -1333,7 +1340,7 @@
 			      (another-env '((x . 4)
 					     (y . 6))))
 			 (set! closure
-			       (enclose-another-env closure another-env))
+			       (%%enclose-another-env closure another-env))
 			 (closure))))
    ;; causes error since z is not exist in the another-env
    (assert-error (lambda ()
@@ -1345,7 +1352,7 @@
 				(another-env '((x . 4)
 					       (y . 6))))
 			   (set! closure
-				 (enclose-another-env closure another-env))
+				 (%%enclose-another-env closure another-env))
 			   (closure)))))))
 
 (define-uim-test-case "test util define-record"



More information about the uim-commit mailing list