optional argument for make-array
This commit is contained in:
parent
4f5a92d921
commit
318475c14b
|
@ -34,7 +34,12 @@
|
|||
(set-array-size! ary size)))
|
||||
|
||||
(define (make-array . rest)
|
||||
(create-array (vector) 0 0 0))
|
||||
(if (null? rest)
|
||||
(make-array 0)
|
||||
(let ((capacity (car rest))
|
||||
(ary (create-array (vector) 0 0 0)))
|
||||
(array-reserve! ary capacity)
|
||||
ary)))
|
||||
|
||||
(define (array-ref ary i)
|
||||
(let ((data (array-data ary)))
|
||||
|
|
Loading…
Reference in New Issue