[uim-commit] r1888 - in branches/r5rs/sigscheme: . test
yamaken at freedesktop.org
yamaken at freedesktop.org
Sat Oct 29 18:52:09 PDT 2005
Author: yamaken
Date: 2005-10-29 18:52:05 -0700 (Sat, 29 Oct 2005)
New Revision: 1888
Modified:
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/test/test-string.scm
Log:
* sigscheme/test/test-string.scm
- Add some tests for string constants
* sigscheme/TODO
- Update
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2005-10-26 20:22:04 UTC (rev 1887)
+++ branches/r5rs/sigscheme/TODO 2005-10-30 01:52:05 UTC (rev 1888)
@@ -16,6 +16,9 @@
* Add integer->char and char->integer procedures
+* Inhibit a mutation on string constants as described in "3.4 Storage model" of
+ R5RS
+
* Fix invalid storage model assumption of ScmOp_append() and qquote_internal()
with ScmRef
Modified: branches/r5rs/sigscheme/test/test-string.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-string.scm 2005-10-26 20:22:04 UTC (rev 1887)
+++ branches/r5rs/sigscheme/test/test-string.scm 2005-10-30 01:52:05 UTC (rev 1888)
@@ -32,6 +32,14 @@
(string-set! str 2 #\u)
str)))
+;; immutable strings: See "3.4 Storage model" of R5RS
+(assert-error "string-set! on constant string #1"
+ (lambda ()
+ (string-set! "foo" 0 #\b)))
+(assert-error "string-set! on constant string #2"
+ (lambda ()
+ (string-set! (symbol->string 'foo) 0 #\b)))
+
;; check string-length
(assert-equal? "alphabet string-length check" 5 (string-length "aiueo"))
(assert-equal? "hiragana string-length check" 5 (string-length "¤¢¤¤¤¦¤¨¤ª"))
More information about the uim-commit
mailing list