Author: yamakenz
Date: Wed Jul 11 03:50:32 2007
New Revision: 4703
Modified:
trunk/doc/COMPATIBILITY
trunk/scm/util.scm
trunk/test/test-util.scm
Log:
* scm/util.scm
- (join): Renamed to list-join
- (list-join):
* Renamed from 'join'
* Swap arguments order
- (string-join): Follow the change
* test/test-util.scm
- Update the "passed revision" comment
- Replace tests for 'join' with for 'list-join'
* doc/COMPATIBILITY
- Update "Specification changes of utility procedures"
Modified: trunk/doc/COMPATIBILITY
==============================================================================
--- trunk/doc/COMPATIBILITY (original)
+++ trunk/doc/COMPATIBILITY Wed Jul 11 03:50:32 2007
@@ -61,30 +61,33 @@
Affects: uim developers, IM developers
Updates: Scheme API
Version: 1.5.0
-Revision: ac4693, ac4694, ac4698, ac4699
+Revision: ac4693, ac4694, ac4698, ac4699, ac4703
Date: 2007-07-11
Modifier: YamaKen
Related:
URL:
Changes:
+ (removed) join
+ (new) list-join
(changed) string-split
(changed) string-join
(changed) sublist
(changed) sublist-rel
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.
- The meaning of 'end' arg of sublist and 'len' arg of sublist-rel has
- been changed to correct one. See test-util.scm for further
- information.
- uim 1.4: (sublist '(1) 0 0) ==> (1)
- (sublist-rel '(1) 0 0) ==> (1)
- uim 1.5: (sublist '(1) 0 0) ==> ()
- (sublist-rel '(1) 0 0) ==> ()
+ - 'join' has been replaced with 'list-join'. The args are swapped
+ - 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.
+ - The meaning of 'end' arg of sublist and 'len' arg of sublist-rel has
+ been changed to correct one. See test-util.scm for further
+ information.
+ uim 1.4: (sublist '(1) 0 0) ==> (1)
+ (sublist-rel '(1) 0 0) ==> (1)
+ uim 1.5: (sublist '(1) 0 0) ==> ()
+ (sublist-rel '(1) 0 0) ==> ()
------------------------------------------------------------------------------
Summary: SRFI-1 procedures replacement
Affects: uim developers, IM developers
Modified: trunk/scm/util.scm
==============================================================================
--- trunk/scm/util.scm (original)
+++ trunk/scm/util.scm Wed Jul 11 03:50:32 2007
@@ -103,8 +103,8 @@
alist)
(cons kons alist)))))
-(define join
- (lambda (sep lst)
+(define list-join
+ (lambda (lst sep)
(if (null? lst)
'()
(cdr (fold-right (lambda (kar kdr)
@@ -115,7 +115,7 @@
;; downward compatible with SRFI-13 string-join
(define string-join
(lambda (str-list sep)
- (apply string-append (join sep str-list))))
+ (apply string-append (list-join str-list sep))))
(define string-split
(lambda (str sep)
Modified: trunk/test/test-util.scm
==============================================================================
--- trunk/test/test-util.scm (original)
+++ trunk/test/test-util.scm Wed Jul 11 03:50:32 2007
@@ -29,7 +29,7 @@
;;; SUCH DAMAGE.
;;;;
-;; These tests are passed at revision 4700 (new repository)
+;; These tests are passed at revision 4703 (new repository)
(use test.unit)
@@ -926,44 +926,44 @@
(assert-equal '((third 3 "3") (second two "two") (first 1 "1"))
(uim 'alist)))
- ("test join"
+ ("test list-join"
(assert-equal ()
- (uim '(join () ())))
+ (uim '(list-join () ())))
(assert-equal '(())
- (uim '(join () '(()))))
+ (uim '(list-join '(()) ())))
(assert-equal '(1)
- (uim '(join () '(1))))
+ (uim '(list-join '(1) ())))
(assert-equal '(() () ())
- (uim '(join () '(() ()))))
+ (uim '(list-join '(() ()) ())))
(assert-equal '(1 () 2)
- (uim '(join () '(1 2))))
+ (uim '(list-join '(1 2) ())))
(assert-equal '(1 () 2 () 3)
- (uim '(join () '(1 2 3))))
+ (uim '(list-join '(1 2 3) ())))
(assert-equal '(one () two () three)
- (uim '(join () '(one two three))))
+ (uim '(list-join '(one two three) ())))
(assert-equal '("1" () "2" () "3")
- (uim '(join () '("1" "2" "3"))))
+ (uim '(list-join '("1" "2" "3") ())))
(assert-equal '(() () () () ())
- (uim '(join () '(() () ()))))
+ (uim '(list-join '(() () ()) ())))
(assert-equal ()
- (uim '(join "/" ())))
+ (uim '(list-join () "/")))
(assert-equal '(())
- (uim '(join "/" '(()))))
+ (uim '(list-join '(()) "/")))
(assert-equal '(1)
- (uim '(join "/" '(1))))
+ (uim '(list-join '(1) "/")))
(assert-equal '(() "/" ())
- (uim '(join "/" '(() ()))))
+ (uim '(list-join '(() ()) "/")))
(assert-equal '(1 "/" 2)
- (uim '(join "/" '(1 2))))
+ (uim '(list-join '(1 2) "/")))
(assert-equal '(1 "/" 2 "/" 3)
- (uim '(join "/" '(1 2 3))))
+ (uim '(list-join '(1 2 3) "/")))
(assert-equal '(one "/" two "/" three)
- (uim '(join "/" '(one two three))))
+ (uim '(list-join '(one two three) "/")))
(assert-equal '("1" "/" "2" "/" "3")
- (uim '(join "/" '("1" "2" "3"))))
+ (uim '(list-join '("1" "2" "3") "/")))
(assert-equal '(() "/" () "/" ())
- (uim '(join "/" '(() () ())))))
+ (uim '(list-join '(() () ()) "/"))))
("test string-join"
(assert-equal ""