Fixing output of substring-fill! and vector-fill!
- fixed substring-fill! and vector-fill! to return void, reflecting the documented return value of unspecified value. Also changes substring-fill! to use define-who instead of repeating 'substring-fill! in all the error messages. 5_4.ss, 5_6.ss original commit: 3f65788b5422693f3648a9e2fe575f464eb31ccd
This commit is contained in:
parent
3863e63ef9
commit
f1b9fc95da
6
LOG
6
LOG
|
@ -758,3 +758,9 @@
|
||||||
primdata.ss
|
primdata.ss
|
||||||
- added support for Visual Studio 2017.15.5
|
- added support for Visual Studio 2017.15.5
|
||||||
wininstall/locate-vcredist.bat
|
wininstall/locate-vcredist.bat
|
||||||
|
- fixed substring-fill! and vector-fill! to return void, reflecting the
|
||||||
|
documented return value of unspecified value. Also changes substring-fill!
|
||||||
|
to use define-who instead of repeating 'substring-fill! in all the error
|
||||||
|
messages.
|
||||||
|
5_4.ss, 5_6.ss
|
||||||
|
|
||||||
|
|
10
s/5_4.ss
10
s/5_4.ss
|
@ -120,19 +120,19 @@
|
||||||
($string-set-immutable! v2)
|
($string-set-immutable! v2)
|
||||||
v2)])))
|
v2)])))
|
||||||
|
|
||||||
(define substring-fill!
|
(define-who substring-fill!
|
||||||
(lambda (s m n c)
|
(lambda (s m n c)
|
||||||
(unless (mutable-string? s)
|
(unless (mutable-string? s)
|
||||||
($oops 'substring-fill! "~s is not a mutable string" s))
|
($oops who "~s is not a mutable string" s))
|
||||||
(unless (char? c)
|
(unless (char? c)
|
||||||
($oops 'substring-fill! "~s is not a character" c))
|
($oops who "~s is not a character" c))
|
||||||
(let ([k (string-length s)])
|
(let ([k (string-length s)])
|
||||||
(unless (and (fixnum? m) (fixnum? n) (fx<= 0 m n k))
|
(unless (and (fixnum? m) (fixnum? n) (fx<= 0 m n k))
|
||||||
($oops 'substring-fill!
|
($oops who
|
||||||
"~s and ~s are not valid start/end indices for ~s"
|
"~s and ~s are not valid start/end indices for ~s"
|
||||||
m n s))
|
m n s))
|
||||||
(do ([i m (fx+ i 1)])
|
(do ([i m (fx+ i 1)])
|
||||||
((fx= i n) s)
|
((fx= i n))
|
||||||
(string-set! s i c)))))
|
(string-set! s i c)))))
|
||||||
|
|
||||||
(set! string-for-each
|
(set! string-for-each
|
||||||
|
|
2
s/5_6.ss
2
s/5_6.ss
|
@ -85,7 +85,7 @@
|
||||||
(unless (mutable-vector? v) ($oops who "~s is not a mutable vector" v))
|
(unless (mutable-vector? v) ($oops who "~s is not a mutable vector" v))
|
||||||
(let ([n (vector-length v)])
|
(let ([n (vector-length v)])
|
||||||
(do ([i 0 (fx+ i 1)])
|
(do ([i 0 (fx+ i 1)])
|
||||||
((fx= i n) v)
|
((fx= i n))
|
||||||
(vector-set! v i obj)))))
|
(vector-set! v i obj)))))
|
||||||
|
|
||||||
(set! fxvector->list
|
(set! fxvector->list
|
||||||
|
|
Loading…
Reference in New Issue
Block a user