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:
Andy Keep 2017-12-12 08:43:01 -05:00
parent 3863e63ef9
commit f1b9fc95da
3 changed files with 12 additions and 6 deletions

6
LOG
View File

@ -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

View File

@ -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

View File

@ -85,7 +85,7 @@
(unless (mutable-vector? v) ($oops who "~s is not a mutable vector" v))
(let ([n (vector-length v)])
(do ([i 0 (fx+ i 1)])
((fx= i n) v)
((fx= i n))
(vector-set! v i obj)))))
(set! fxvector->list