[uim-commit] r3011 - in branches/r5rs/sigscheme: . doc src test
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Jan 27 20:13:33 PST 2006
Author: yamaken
Date: 2006-01-27 20:13:23 -0800 (Fri, 27 Jan 2006)
New Revision: 3011
Modified:
branches/r5rs/sigscheme/NEWS
branches/r5rs/sigscheme/README
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/doc/spec.txt
branches/r5rs/sigscheme/src/operations-srfi1.c
branches/r5rs/sigscheme/test/test-list.scm
Log:
* sigscheme/test/test-list.scm
- Add tests for set-car! and set-cdr!
* sigscheme/src/operations-srfi1.c
- (scm_p_srfi1_list_copy): Cause error
* sigscheme/NEWS
* sigscheme/TODO
* sigscheme/doc/spec.txt
* sigscheme/README
- Update
Modified: branches/r5rs/sigscheme/NEWS
===================================================================
--- branches/r5rs/sigscheme/NEWS 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/NEWS 2006-01-28 04:13:23 UTC (rev 3011)
@@ -8,6 +8,8 @@
- Add lacking string predicates and complete all R5RS string procedures
+ - Support constant list (storage-compact does not)
+
- Support constant vector (storage-compact is not yet)
- Add quote-less vector literal check
Modified: branches/r5rs/sigscheme/README
===================================================================
--- branches/r5rs/sigscheme/README 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/README 2006-01-28 04:13:23 UTC (rev 3011)
@@ -16,7 +16,7 @@
- SRFI-23 : Error Reporting Mechanism
- SRFI-34 : Exception Handling for Programs
- SRFI-38 : External Representation for Data with Shared Structure
- - SRFI-60 : Integer as Bits
+ - SRFI-60 : Integer as Bits (partial)
- SRFI-75 : R6RS Unicode data (partial)
- Multibyte character support
- Partial SIOD compatibility
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/TODO 2006-01-28 04:13:23 UTC (rev 3011)
@@ -25,11 +25,6 @@
- Make the tests passed on actual 64bit environment with compact
representation
-* Confirm behavior of constant vector and list
- - Investigate behavior of them in Scheme implementations other than Gauche
- and Guile, and record it into doc/spec.txt
- - Implement if needed
-
* Confirm R5RS and SRFI conformance for each function implementation
* Confirm public API
Modified: branches/r5rs/sigscheme/doc/spec.txt
===================================================================
--- branches/r5rs/sigscheme/doc/spec.txt 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/doc/spec.txt 2006-01-28 04:13:23 UTC (rev 3011)
@@ -6,7 +6,7 @@
To be described.
- - 64bit environment is being supported
+ - 64-bit data models are being supported
* R5RS conformance
@@ -28,7 +28,7 @@
- Numbers
- Integer part is only implemented.
+ Only integer part is implemented.
- Characters
@@ -69,9 +69,13 @@
- Constant list
- SigScheme allows modification of constant list object for convenience
- although it is required to be an error in R5RS.
+ SigScheme inhibits modification of constant list object by default as
+ specified in R5RS, if the storage implementation suports it. storage-fatty
+ supports it, but storage-compact does not due to no bit space for pair
+ object.
+ The behavior can be changed by SCM_CONST_LIST_LITERAL.
+
> 4.1.2 Literal expressions
>
> `(quote <datum>)' may be abbreviated as '<datum>. The two notations
@@ -98,19 +102,14 @@
> (define (g) '(constant-list))
> (set-car! (g) 3) ==> error
- sscm> (define (g) '(constant-list))
- (g)
- sscm> (set-car! (g) 3)
- 3
-
- The object is modified as (3) in SigScheme. Gauche and Guile are also
- behaves so.
-
- Constant vector
- SigScheme allows modification of constant vector object by default for
- convenience although it is required to be an error in R5RS.
+ SigScheme inhibits modification of constant vector object by default as
+ specified in R5RS, if the storage implementation suports it. storage-fatty
+ supports it, but storage-compact is not yet.
+ The behavior can be changed by SCM_CONST_VECTOR_LITERAL.
+
> 6.3.6 Vectors
>
> procedure: vector-set! vector k obj
@@ -118,12 +117,6 @@
> (vector-set! '#(0 1 2) 1 "doe")
> ==> error ; constant vector
- The object is modified as #(0 "doe" 2) in SigScheme. Gauche and Guile are
- also behaves so.
-
- The behavior can be configured to R5RS-compatible with
- SCM_CONST_VECTOR_LITERAL
-
- Quote-less null list
SigScheme allows quote-less null list by default for convenience and
@@ -142,12 +135,10 @@
- Quote-less vector literal
- Sigscheme allows quote-less vector literal by default for convenience,
- although quotation is required in formal R5RS syntax. This specification
- may be changed to make notation rule consistent with constant list.
+ Sigscheme inhibits quote-less vector literal by default, as specified in
+ R5RS.
- The behavior can be configured to R5RS-compatible with
- SCM_STRICT_VECTOR_FORM
+ The behavior can be changed by SCM_STRICT_VECTOR_FORM.
> 6.3.6 Vectors
>
@@ -166,12 +157,10 @@
> ==> #(0 (2 2 2 2) "Anna")
sscm> #(1 2 3)
- #(1 2 3)
+ Error: eval: #() is not a valid R5RS form. use '#() instead
sscm> '#(1 2 3)
#(1 2 3)
- Gauche and Guile are also behaves above.
-
- Environment specifiers
(null-environment) and (scheme-report-environment) does not return correct
Modified: branches/r5rs/sigscheme/src/operations-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/src/operations-srfi1.c 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/src/operations-srfi1.c 2006-01-28 04:13:23 UTC (rev 3011)
@@ -198,6 +198,7 @@
return head;
#endif
+ ERR("list-copy: bug: broken implementation");
}
ScmObj
Modified: branches/r5rs/sigscheme/test/test-list.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-list.scm 2006-01-28 03:33:28 UTC (rev 3010)
+++ branches/r5rs/sigscheme/test/test-list.scm 2006-01-28 04:13:23 UTC (rev 3011)
@@ -67,6 +67,52 @@
(assert-equal? "cdr test1" '(b c d) (cdr '((a) b c d)))
(assert-equal? "cdr test2" 2 (cdr '(1 . 2)))
+(tn "set-car!")
+(define my-set-car!
+ (lambda (kons x)
+ (set-car! kons x)
+ kons))
+(assert-error (tn) (lambda() (my-set-car! (list) 2)))
+(assert-equal? (tn) '(2) (my-set-car! (list 0) 2))
+(assert-equal? (tn) '(2 . 1) (my-set-car! (cons 0 1) 2))
+(assert-equal? (tn) '(2 1) (my-set-car! (list 0 1) 2))
+(assert-equal? (tn) '(2 1 . 2) (my-set-car! (cons 0 '(1 . 2)) 2))
+(if (and (provided? "sigscheme")
+ (provided? "const-list-literal"))
+ (begin
+ (assert-error (tn) (lambda () (my-set-car! '(0) 2)))
+ (assert-error (tn) (lambda () (my-set-car! '(0 . 1) 2)))
+ (assert-error (tn) (lambda () (my-set-car! '(0 1) 2)))
+ (assert-error (tn) (lambda () (my-set-car! '(0 1 . 2) 2))))
+ (begin
+ (assert-equal? (tn) '(2) (my-set-car! '(0) 2))
+ (assert-equal? (tn) '(2 . 1) (my-set-car! '(0 . 1) 2))
+ (assert-equal? (tn) '(2 1) (my-set-car! '(0 1) 2))
+ (assert-equal? (tn) '(2 1 . 2) (my-set-car! '(0 1 . 2) 2))))
+
+(tn "set-cdr!")
+(define my-set-cdr!
+ (lambda (kons x)
+ (set-cdr! kons x)
+ kons))
+(assert-error (tn) (lambda() (my-set-cdr! (list) 2)))
+(assert-equal? (tn) '(0 . 2) (my-set-cdr! (list 0) 2))
+(assert-equal? (tn) '(0 . 2) (my-set-cdr! (cons 0 1) 2))
+(assert-equal? (tn) '(0 . 2) (my-set-cdr! (list 0 1) 2))
+(assert-equal? (tn) '(0 . 2) (my-set-cdr! (cons 0 '(1 . 2)) 2))
+(if (and (provided? "sigscheme")
+ (provided? "const-list-literal"))
+ (begin
+ (assert-error (tn) (lambda () (my-set-cdr! '(0) 2)))
+ (assert-error (tn) (lambda () (my-set-cdr! '(0 . 1) 2)))
+ (assert-error (tn) (lambda () (my-set-cdr! '(0 1) 2)))
+ (assert-error (tn) (lambda () (my-set-cdr! '(0 1 . 2) 2))))
+ (begin
+ (assert-equal? (tn) '(0 . 2) (my-set-cdr! '(0) 2))
+ (assert-equal? (tn) '(0 . 2) (my-set-cdr! '(0 . 1) 2))
+ (assert-equal? (tn) '(0 . 2) (my-set-cdr! '(0 1) 2))
+ (assert-equal? (tn) '(0 . 2) (my-set-cdr! '(0 1 . 2) 2))))
+
; null?
(assert-true "null? test1" (null? '()))
(assert-equal? "null? test2" #f (null? "aiueo"))
More information about the uim-commit
mailing list