(if (fix:> j 1)
(begin
(string-set! s j #\")
- (set-string-length! s (fix:+ j 1))
- (list s))
+ (list (substring s 0 (fix:+ j 1))))
'())))))
\f
(define (handle-objects start-offset)
(fixed-assignment 'SET-CAR! (ucode-type pair) 0)
(fixed-assignment 'SET-CDR! (ucode-type pair) 1))
-(define-open-coder/effect 'SET-STRING-LENGTH!
- (simple-open-coder
- (lambda (combination expressions finish)
- (let ((object (car expressions))
- (length (cadr expressions)))
- (open-code:with-checks
- combination
- (let ((name 'SET-STRING-LENGTH!)
- (block (combination/block combination)))
- (list (open-code:type-check object (ucode-type string) name block)
- (open-code:index-fixnum-check length name block)))
- (finish-vector-assignment (rtl:locative-offset object 1)
- (rtl:make-object->datum length)
- finish)
- finish
- 'SET-STRING-LENGTH!
- expressions)))
- '(0 1)
- internal-close-coding-for-type-or-range-checks))
-
(let ((make-assignment
(lambda (name type)
(define-open-coder/effect name
(parent (runtime))
(export-deprecated () ;ignored on 9.2 hosts
(guarantee-vector-8b guarantee-string)
- (set-vector-8b-length! set-string-length!)
(vector-8b-length string-length)
(vector-8b? string?)
error:not-string
vector-8b-set!)
(export () ;temporary duplicate for 9.2 hosts
(guarantee-vector-8b guarantee-string)
- (set-vector-8b-length! set-string-length!)
(vector-8b-length string-length)
(vector-8b? string?)
error:not-string
lisp-string->camel-case
reverse-string
reverse-substring
- set-string-length!
string-capitalize
string-capitalized?
string-compare
;;;; Primitives
(define-primitives
- (set-string-length! 2)
(string-allocate 1)
(string-length 1)
(string-ref 2)
(copy-memory s ptr maxlen)
(global-unlock mem)
(close-clipboard)
- (set-string-length! s (vector-8b-find-next-char s 0 maxlen 0))
- s))))
+ (substring s 0 (vector-8b-find-next-char s 0 maxlen 0))))))
(define (win32-screen-width)
(get-system-metrics SM_CXSCREEN))