mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 14:49:17 +02:00
Added optional args to string->vector
This commit is contained in:
parent
def5bba06a
commit
0c941d2e8d
1 changed files with 1 additions and 3 deletions
|
@ -773,11 +773,9 @@
|
||||||
(loop (+ i 1)
|
(loop (+ i 1)
|
||||||
(cons (string-ref str i) lst))))))
|
(cons (string-ref str i) lst))))))
|
||||||
(loop start '())))
|
(loop start '())))
|
||||||
;; TODO: need to extend string->list to take optional start/end args,
|
|
||||||
;; then modify this function to work with optional args, too
|
|
||||||
(define (string->vector str . opts)
|
(define (string->vector str . opts)
|
||||||
(list->vector
|
(list->vector
|
||||||
(string->list str)))
|
(apply string->list (cons str opts))))
|
||||||
(define (string-copy str . opts)
|
(define (string-copy str . opts)
|
||||||
(letrec ((len (string-length str))
|
(letrec ((len (string-length str))
|
||||||
(start (if (> (length opts) 0) (car opts) 0))
|
(start (if (> (length opts) 0) (car opts) 0))
|
||||||
|
|
Loading…
Add table
Reference in a new issue