43 lines
620 B
Scheme
43 lines
620 B
Scheme
(import (scheme base)
|
|
(scheme write)
|
|
(picrin array))
|
|
|
|
(define ary (make-array))
|
|
|
|
(write ary)
|
|
(newline)
|
|
(array-push! ary 1)
|
|
(write ary)
|
|
(newline)
|
|
(array-push! ary 2)
|
|
(write ary)
|
|
(newline)
|
|
(array-push! ary 3)
|
|
(write ary)
|
|
(newline)
|
|
(write (array-pop! ary))
|
|
(newline)
|
|
(write (array-pop! ary))
|
|
(newline)
|
|
(write (array-pop! ary))
|
|
(newline)
|
|
|
|
(write ary)
|
|
(newline)
|
|
(array-unshift! ary 1)
|
|
(write ary)
|
|
(newline)
|
|
(array-unshift! ary 2)
|
|
(write ary)
|
|
(newline)
|
|
(array-unshift! ary 3)
|
|
(write ary)
|
|
(newline)
|
|
(write (array-shift! ary))
|
|
(newline)
|
|
(write (array-shift! ary))
|
|
(newline)
|
|
(write (array-shift! ary))
|
|
(newline)
|
|
|