move picrin/array to contrib/
This commit is contained in:
parent
1be4fd10f9
commit
5f454626f6
1
Makefile
1
Makefile
|
@ -11,7 +11,6 @@ PICRIN_LIBS = \
|
||||||
piclib/picrin/base.scm\
|
piclib/picrin/base.scm\
|
||||||
piclib/picrin/macro.scm\
|
piclib/picrin/macro.scm\
|
||||||
piclib/picrin/record.scm\
|
piclib/picrin/record.scm\
|
||||||
piclib/picrin/array.scm\
|
|
||||||
piclib/picrin/control.scm\
|
piclib/picrin/control.scm\
|
||||||
piclib/picrin/experimental/lambda.scm\
|
piclib/picrin/experimental/lambda.scm\
|
||||||
piclib/picrin/syntax-rules.scm\
|
piclib/picrin/syntax-rules.scm\
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
CONTRIB_LIBS += $(wildcard contrib/90.array/*.scm)
|
||||||
|
|
||||||
|
CONTRIB_TESTS += test-array
|
||||||
|
|
||||||
|
test-array: bin/picrin
|
||||||
|
picrin contrib/90.array/t/array.scm
|
|
@ -0,0 +1,26 @@
|
||||||
|
(import (scheme base)
|
||||||
|
(scheme write)
|
||||||
|
(picrin array)
|
||||||
|
(picrin test))
|
||||||
|
|
||||||
|
(test-begin)
|
||||||
|
|
||||||
|
(define ary (make-array))
|
||||||
|
|
||||||
|
(array-push! ary 1)
|
||||||
|
(array-push! ary 2)
|
||||||
|
(array-push! ary 3)
|
||||||
|
|
||||||
|
(test 3 (array-pop! ary))
|
||||||
|
(test 2 (array-pop! ary))
|
||||||
|
(test 1 (array-pop! ary))
|
||||||
|
|
||||||
|
(array-unshift! ary 1)
|
||||||
|
(array-unshift! ary 2)
|
||||||
|
(array-unshift! ary 3)
|
||||||
|
|
||||||
|
(test 3 (array-shift! ary))
|
||||||
|
(test 2 (array-shift! ary))
|
||||||
|
(test 1 (array-shift! ary))
|
||||||
|
|
||||||
|
(test-end)
|
|
@ -996,12 +996,11 @@ const char pic_boot[][80] = {
|
||||||
") . ,(list-ref spec 2)))\n (else\n (error \"malformed expo",
|
") . ,(list-ref spec 2)))\n (else\n (error \"malformed expo",
|
||||||
"rt\")))))\n (export\n (lambda (spec)\n (let ((slot (co",
|
"rt\")))))\n (export\n (lambda (spec)\n (let ((slot (co",
|
||||||
"llect spec)))\n (library-export (car slot) (cdr slot))))))\n (f",
|
"llect spec)))\n (library-export (car slot) (cdr slot))))))\n (f",
|
||||||
"or-each export (cdr form)))))\n\n(export define-library\n cond-expand\n ",
|
"or-each export (cdr form)))))\n\n(export define lambda quote set! if begin define-",
|
||||||
" import\n export)\n\n(export define lambda quote set! if begin define-macro",
|
"macro\n let let* letrec letrec*\n let-values let*-values define-valu",
|
||||||
"\n let let* letrec letrec*\n let-values let*-values define-values\n ",
|
"es\n quasiquote unquote unquote-splicing\n and or\n cond case ",
|
||||||
" quasiquote unquote unquote-splicing\n and or\n cond case else ",
|
"else =>\n do when unless\n parameterize\n define-syntax\n ",
|
||||||
"=>\n do when unless\n parameterize\n define-syntax\n syn",
|
" syntax-quote syntax-unquote\n syntax-quasiquote syntax-unquote-splicing\n",
|
||||||
"tax-quote syntax-unquote\n syntax-quasiquote syntax-unquote-splicing\n ",
|
|
||||||
" let-syntax letrec-syntax\n syntax-error)\n\n\n",
|
" let-syntax letrec-syntax\n syntax-error)\n\n\n",
|
||||||
"",
|
"",
|
||||||
""
|
""
|
||||||
|
|
42
t/array.scm
42
t/array.scm
|
@ -1,42 +0,0 @@
|
||||||
(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)
|
|
||||||
|
|
Loading…
Reference in New Issue