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
|
||||
- added support for Visual Studio 2017.15.5
|
||||
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)
|
||||
v2)])))
|
||||
|
||||
(define substring-fill!
|
||||
(define-who substring-fill!
|
||||
(lambda (s m n c)
|
||||
(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)
|
||||
($oops 'substring-fill! "~s is not a character" c))
|
||||
($oops who "~s is not a character" c))
|
||||
(let ([k (string-length s)])
|
||||
(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"
|
||||
m n s))
|
||||
(do ([i m (fx+ i 1)])
|
||||
((fx= i n) s)
|
||||
((fx= i n))
|
||||
(string-set! s i c)))))
|
||||
|
||||
(set! string-for-each
|
||||
|
|
Loading…
Reference in New Issue
Block a user