picrin/t/array.scm

43 lines
620 B
Scheme
Raw Normal View History

2014-07-15 07:59:29 -04:00
(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)
2014-07-15 08:26:08 -04:00
(write (array-pop! ary))
2014-07-15 07:59:29 -04:00
(newline)
2014-07-15 08:26:08 -04:00
(write (array-pop! ary))
2014-07-15 07:59:29 -04:00
(newline)
2014-07-15 08:26:08 -04:00
(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))
2014-07-15 07:59:29 -04:00
(newline)