Author: yamakenz
Date: Tue Jul 10 23:11:14 2007
New Revision: 4694
Modified:
trunk/doc/COMPATIBILITY
trunk/scm/custom.scm
trunk/scm/mana.scm
trunk/scm/uim-module-manager.scm
trunk/scm/util.scm
trunk/test/test-util.scm
Log:
* scm/util.scm
- (string-join): The 2 arguments has been swapped to be compatible
with SRFI-13
* scm/custom.scm
- (custom-list-as-literal, custom-definition-as-literal): Follow the
specification change of string-join
* scm/mana.scm
- (mana-list->string): Ditto
* scm/uim-module-manager.scm
- (update-loader-scm): Ditto
* test/test-util.scm
- Update the "passed revision" comment
- Follow the specification change of string-join
* doc/COMPATIBILITY
- Update "Specification changes of utility procedures"
Modified: trunk/doc/COMPATIBILITY
==============================================================================
--- trunk/doc/COMPATIBILITY (original)
+++ trunk/doc/COMPATIBILITY Tue Jul 10 23:11:14 2007
@@ -61,18 +61,21 @@
Affects: uim developers, IM developers
Updates: Scheme API
Version: 1.5.0
-Revision: ac4693
+Revision: ac4693, ac4694
Date: 2007-07-11
Modifier: YamaKen
Related:
URL:
Changes:
(changed) string-split
+ (changed) string-join
Description:
Now string-split produces empty strings as follows. See
test-uim-utils.scm for further information.
uim 1.4: (string-split "hhh" "h") ==> ()
uim 1.5: (string-split "hhh" "h") ==> ("" "" "" "")
+ The 2 arguments of string-join has been swapped to be compatible
+ with SRFI-13 string-join.
------------------------------------------------------------------------------
Summary: SRFI-1 procedures replacement
Affects: uim developers, IM developers
Modified: trunk/scm/custom.scm
==============================================================================
--- trunk/scm/custom.scm (original)
+++ trunk/scm/custom.scm Tue Jul 10 23:11:14 2007
@@ -675,7 +675,7 @@
(else
"")))
lst)))
- (string-append "'(" (string-join " " canonicalized) ")"))))
+ (string-append "'(" (string-join canonicalized " ") ")"))))
;; API
(define custom-value-as-literal
@@ -707,7 +707,7 @@
(val (custom-value-as-literal sym))
(hooked (custom-call-hook-procs sym custom-literalize-hooks)))
(if (not (null? hooked))
- (string-join "\n" hooked)
+ (string-join hooked "\n")
(apply string-append
(append
(list "(define " var " " val ")")
Modified: trunk/scm/mana.scm
==============================================================================
--- trunk/scm/mana.scm (original)
+++ trunk/scm/mana.scm Tue Jul 10 23:11:14 2007
@@ -95,7 +95,7 @@
(else
"")))
lst)))
- (string-append "(" (string-join " " canonicalized) ")"))))
+ (string-append "(" (string-join canonicalized " ") ")"))))
(define mana-set-string!
(lambda (mc yomi yomi-len)
Modified: trunk/scm/uim-module-manager.scm
==============================================================================
--- trunk/scm/uim-module-manager.scm (original)
+++ trunk/scm/uim-module-manager.scm Tue Jul 10 23:11:14 2007
@@ -139,7 +139,7 @@
"(define-record 'stub-im stub-im-rec-spec)\n\n"
"(define stub-im-list\n"
" '(\n"
- (string-join "\n" (stub-im-generate-all-stub-im-list))
+ (string-join (stub-im-generate-all-stub-im-list) "\n")
" ))\n\n"
"(for-each (lambda (stub)\n"
" (if (memq (stub-im-name stub) enabled-im-list)\n"
Modified: trunk/scm/util.scm
==============================================================================
--- trunk/scm/util.scm (original)
+++ trunk/scm/util.scm Tue Jul 10 23:11:14 2007
@@ -149,8 +149,9 @@
(cdr (apply append (zip (make-list len sep)
list)))))))
+;; downward compatible with SRFI-13 string-join
(define string-join
- (lambda (sep str-list)
+ (lambda (str-list sep)
(apply string-append (join sep str-list))))
(define string-split
Modified: trunk/test/test-util.scm
==============================================================================
--- trunk/test/test-util.scm (original)
+++ trunk/test/test-util.scm Tue Jul 10 23:11:14 2007
@@ -29,7 +29,7 @@
;;; SUCH DAMAGE.
;;;;
-;; These tests are passed at revision 4682 (new repository)
+;; These tests are passed at revision 4694 (new repository)
(use test.unit)
@@ -496,43 +496,43 @@
(assert-equal ""
(uim '(string-join () ())))
(assert-error (lambda ()
- (uim '(string-join () '(())))))
+ (uim '(string-join '(()) ()))))
(assert-error (lambda ()
- (uim '(string-join () '(1)))))
+ (uim '(string-join '(1) ()))))
(assert-error (lambda ()
- (uim '(string-join () '(() ())))))
+ (uim '(string-join '(() ()) ()))))
(assert-error (lambda ()
- (uim '(string-join () '(1 2)))))
+ (uim '(string-join '(1 2) ()))))
(assert-error (lambda ()
- (uim '(string-join () '(1 2 3)))))
+ (uim '(string-join '(1 2 3) ()))))
(assert-error (lambda ()
- (uim '(string-join () '(one two three)))))
+ (uim '(string-join '(one two three) ()))))
(assert-error (lambda ()
- (uim '(string-join () '("1" "2" "3")))))
+ (uim '(string-join '("1" "2" "3") ()))))
(assert-error (lambda ()
- (uim '(string-join () '(() () ())))))
+ (uim '(string-join '(() () ()) ()))))
(assert-equal ""
- (uim '(string-join "/" ())))
+ (uim '(string-join () "/")))
(assert-equal ""
- (uim '(string-join "/" '(""))))
+ (uim '(string-join '("") "/")))
(assert-equal "1"
- (uim '(string-join "/" '("1"))))
+ (uim '(string-join '("1") "/")))
(assert-equal "1/2"
- (uim '(string-join "/" '("1" "2"))))
+ (uim '(string-join '("1" "2") "/")))
(assert-equal "1/2/3"
- (uim '(string-join "/" '("1" "2" "3"))))
+ (uim '(string-join '("1" "2" "3") "/")))
(assert-equal ""
- (uim '(string-join "-sep-" ())))
+ (uim '(string-join () "-sep-")))
(assert-equal ""
- (uim '(string-join "-sep-" '(""))))
+ (uim '(string-join '("") "-sep-")))
(assert-equal "1"
- (uim '(string-join "-sep-" '("1"))))
+ (uim '(string-join '("1") "-sep-")))
(assert-equal "1-sep-2"
- (uim '(string-join "-sep-" '("1" "2"))))
+ (uim '(string-join '("1" "2") "-sep-")))
(assert-equal "1-sep-2-sep-3"
- (uim '(string-join "-sep-" '("1" "2" "3")))))
+ (uim '(string-join '("1" "2" "3") "-sep-"))))
("test string-append-map"
(assert-equal ""