Remove gc scaffolding.
* tests/gc-0.test: Remove. * tests/gc-1.test: Remove. * tests/gc-2.test: Remove. * tests/gc-2a.test: Remove. * tests/gc-3.test: Remove. * tests/gc-4.test: Remove. * tests/gc-5.test: Remove. * tests/gc-6.test: Remove. * tests/gc.test:Remove.
This commit is contained in:
parent
8460c4ab52
commit
26539214d9
|
@ -1,98 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $(dirname $0)/..//mes "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define zero (core:make-cell 2 0 0))
|
||||
(define one (core:make-cell 2 0 1))
|
||||
(define pair (core:make-cell 3 zero one))
|
||||
(define zero-list (core:make-cell 3 zero '()))
|
||||
(define v (make-vector 1))
|
||||
(display v) (newline)
|
||||
(vector-set! v 0 88)
|
||||
(define zero-v-list (core:make-cell 3 v zero-list))
|
||||
(define list (core:make-cell 3 (make-cell 3 zero one) zero-v-list))
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "list: ") (display list) (newline)
|
||||
(display "v: ") (display v) (newline)
|
||||
;; (display "list: ") (display list) (newline)
|
||||
;; (display "v: ") (display v) (newline)
|
||||
;;(gc-show)
|
||||
;;(display "cells:") (display %the-cells) (newline)
|
||||
;;(gc list)
|
||||
;; (display "gc done\n")
|
||||
;; (display "scm old:") (display %new-cells) (newline)
|
||||
;; (display "scm cells:") (display %the-cells) (newline)
|
|
@ -1,49 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define first (core:make-cell 0 0 #\F)) (newline)
|
||||
|
||||
(define one (core:make-cell 2 0 1))
|
||||
(display "\n one=") (display one) (newline)
|
||||
(define two (core:make-cell 2 0 2))
|
||||
(define pair2-nil (core:make-cell 3 two '()))
|
||||
(display "\npair2-nil=") (display pair2-nil) (newline)
|
||||
(gc-show)
|
||||
|
||||
(define list1-2 (core:make-cell 3 one pair2-nil))
|
||||
(display "\nlist1-2=") (display list1-2) (newline)
|
||||
(gc-show)
|
||||
|
||||
(define three (core:make-cell 2 0 3))
|
||||
(define four (core:make-cell 2 0 4))
|
||||
(define pair4-nil (core:make-cell 3 four '()))
|
||||
(define list3-4 (core:make-cell 3 three pair4-nil))
|
||||
(define list1234 (core:make-cell 3 list1-2 list3-4))
|
||||
(gc-show)
|
||||
(gc list1234)
|
||||
(gc-show)
|
360
tests/gc-2.test
360
tests/gc-2.test
|
@ -1,360 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;; (define *top-define-a* '*top-define-a*)
|
||||
;; (display (eq? *top-define-a* '*top-define-a*))
|
||||
;; (newline)
|
||||
;; (begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (newline)
|
||||
|
||||
(display 'HALLO) (newline)
|
||||
(define (result r)
|
||||
(display 'result:) (display r) (newline))
|
||||
|
||||
(define (cadr x) (car (cdr x)))
|
||||
(define (simple-map f l)
|
||||
(if (null? l) '()
|
||||
(cons (f (car l)) (simple-map f (cdr l)))))
|
||||
|
||||
(define-macro (simple-let bindings . rest)
|
||||
(cons (cons 'lambda (cons (simple-map car bindings) rest))
|
||||
(simple-map cadr bindings)))
|
||||
|
||||
(define-macro (let bindings . rest)
|
||||
(cons 'simple-let (cons bindings rest)))
|
||||
|
||||
(define blub? #t)
|
||||
;; (define result
|
||||
;; (let ((pass 0)
|
||||
;; (fail 0))
|
||||
;; (lambda (. t)
|
||||
;; (display 'result:) (display t) (newline)
|
||||
;; (set! pass (+ pass 1)))))
|
||||
|
||||
(display "OKAY\n")
|
||||
|
||||
(define-macro (or . x)
|
||||
(if (null? x) #f
|
||||
(if (null? (cdr x)) (car x)
|
||||
(list 'if (car x) (car x)
|
||||
(cons 'or (cdr x))))))
|
||||
|
||||
(define-macro (cond . clauses)
|
||||
(list 'if (null? clauses) *unspecified*
|
||||
(if (null? (cdr clauses))
|
||||
(list 'if (car (car clauses))
|
||||
(list (cons 'lambda (cons '() (cons (car (car clauses)) (cdr (car clauses))))))
|
||||
*unspecified*)
|
||||
(if (eq? (car (cadr clauses)) 'else)
|
||||
(list 'if (car (car clauses))
|
||||
(list (cons 'lambda (cons '() (car clauses))))
|
||||
(list (cons 'lambda (cons '() (cons *unspecified* (cdr (cadr clauses)))))))
|
||||
(list 'if (car (car clauses))
|
||||
(list (cons 'lambda (cons '() (car clauses))))
|
||||
(cons 'cond (cdr clauses)))))))
|
||||
|
||||
(define result
|
||||
(let ((pass 0)
|
||||
(fail 0))
|
||||
(lambda (. t)
|
||||
(display 'result:) (display t) (newline)
|
||||
(set! pass (+ pass 1)))))
|
||||
|
||||
(define result
|
||||
(let ((pass 0)
|
||||
(fail 0))
|
||||
(lambda (. t)
|
||||
(cond ((or (null? t) (eq? (car t) result)) (list pass fail))
|
||||
((eq? (car t) 'report)
|
||||
(newline)
|
||||
(display "passed: ") (display pass) (newline)
|
||||
(display "failed: ") (display fail) (newline)
|
||||
(display "total: ") (display (+ pass fail)) (newline)
|
||||
;;(exit fail)
|
||||
)
|
||||
((car t)
|
||||
#t
|
||||
#t
|
||||
#t
|
||||
;;(blaat)
|
||||
(display ": pass")
|
||||
;;(newline)
|
||||
;;(set! pass (+ pass 1))
|
||||
#t
|
||||
)
|
||||
(#t (display ": fail") (newline) (set! fail (+ fail 1)))))))
|
||||
|
||||
(define-macro (pass-if name t)
|
||||
(list
|
||||
'begin
|
||||
(list display ''xxxtest:) (list display name)
|
||||
(list result t)))
|
||||
|
||||
(display 'foo-test:) (newline)
|
||||
(display 1)(newline)
|
||||
(display 2)(newline)
|
||||
(display 3)(newline)
|
||||
(display 4)(newline)
|
||||
(display 5)(newline)
|
||||
(display 6)(newline)
|
||||
(display 7)(newline)
|
||||
(display 8)(newline)
|
||||
(display 9)(newline)
|
||||
|
||||
(pass-if "if" (eq? (if #t 'true) 'true))
|
||||
(pass-if "if 2" (eq? (if #f #f) *unspecified*))
|
||||
(pass-if "if 3" (eq? (if (eq? 0 '0) 'true 'false) 'true))
|
||||
(pass-if "if 4" (eq? (if (= 1 2) 'true 'false) 'false))
|
||||
|
||||
(display 10)(newline)
|
||||
(display 11)(newline)
|
||||
(display 12)(newline)
|
||||
(display 13)(newline)
|
||||
(display 14)(newline)
|
||||
(display 15)(newline)
|
||||
(display 16)(newline)
|
||||
(display 17)(newline)
|
||||
(display 18)(newline)
|
||||
(display 19)(newline)
|
||||
|
||||
(display 14)(newline)
|
||||
(display 15)(newline)
|
||||
(display 16)(newline)
|
||||
(display 17)(newline)
|
||||
(display 18)(newline)
|
||||
(display 19)(newline)
|
||||
|
||||
(define (m x) (* 2 x))
|
||||
(display 'multiply:)
|
||||
(display (m 1)) (newline)
|
||||
(display (m 2)) (newline)
|
||||
(display (m 3)) (newline)
|
||||
(display (m 4)) (newline)
|
||||
|
||||
;; (define (result r)
|
||||
;; (display 'result:) (display r) (newline))
|
||||
|
||||
(define-macro (pass-if name t)
|
||||
(list
|
||||
'begin
|
||||
(list display ''xxxtest:) (list display name)
|
||||
(list result t)))
|
||||
|
||||
(pass-if 'first-dummy: #t)
|
||||
|
||||
(display 20)(newline)
|
||||
(display 21)(newline)
|
||||
(display 22)(newline)
|
||||
(display 23)(newline)
|
||||
(display 24)(newline)
|
||||
(display 25)(newline)
|
||||
(display 26)(newline)
|
||||
(display 27)(newline)
|
||||
(display 28)(newline)
|
||||
(display 29)(newline)
|
||||
(display 30)(newline)
|
||||
|
||||
(define *top-define-a* '*top-define-a*)
|
||||
(display (eq? *top-define-a* '*top-define-a*))
|
||||
(newline)
|
||||
(begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
(display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
(newline)
|
||||
|
||||
(display 31)(newline)
|
||||
(display 32)(newline)
|
||||
(display 33)(newline)
|
||||
(display 34)(newline)
|
||||
(display 35)(newline)
|
||||
(display 36)(newline)
|
||||
(display 37)(newline)
|
||||
(display 38)(newline)
|
||||
(display 39)(newline)
|
||||
(display 40)(newline)
|
||||
|
||||
;; (display 41)(newline)
|
||||
;; (display 42)(newline)
|
||||
;; (display 43)(newline)
|
||||
;; (display 44)(newline)
|
||||
;; (display 45)(newline)
|
||||
;; (display 46)(newline)
|
||||
;; (display 47)(newline)
|
||||
;; (display 48)(newline)
|
||||
;; (display 49)(newline)
|
||||
;; (display 50)(newline)
|
||||
;; (display 51)(newline)
|
||||
;; (display 52)(newline)
|
||||
;; (display 53)(newline)
|
||||
;; (display 54)(newline)
|
||||
;; (display 55)(newline)
|
||||
;; (display 56)(newline)
|
||||
;; (display 57)(newline)
|
||||
;; (display 58)(newline)
|
||||
;; (display 59)(newline)
|
||||
;; (display 60)(newline)
|
||||
;; (display 61)(newline)
|
||||
;; (display 62)(newline)
|
||||
;; (display 63)(newline)
|
||||
;; (display 64)(newline)
|
||||
;; (display 65)(newline)
|
||||
;; (display 66)(newline)
|
||||
;; (display 67)(newline)
|
||||
;; (display 68)(newline)
|
||||
;; (display 69)(newline)
|
||||
;; (display 70)(newline)
|
||||
;; (display 71)(newline)
|
||||
;; (display 72)(newline)
|
||||
;; (display 73)(newline)
|
||||
;; (display 74)(newline)
|
||||
;; (display 75)(newline)
|
||||
;; (display 76)(newline)
|
||||
;; (display 77)(newline)
|
||||
;; (display 78)(newline)
|
||||
;; (display 79)(newline)
|
||||
;; (display 80)(newline)
|
||||
;; (display 81)(newline)
|
||||
;; (display 82)(newline)
|
||||
;; (display 83)(newline)
|
||||
;; (display 84)(newline)
|
||||
;; (display 85)(newline)
|
||||
;; (display 86)(newline)
|
||||
;; (display 87)(newline)
|
||||
;; (display 88)(newline)
|
||||
;; (display 89)(newline)
|
||||
;; (display 90)(newline)
|
||||
;; (display 91)(newline)
|
||||
;; (display 92)(newline)
|
||||
;; (display 93)(newline)
|
||||
;; (display 94)(newline)
|
||||
;; (display 95)(newline)
|
||||
;; (display 96)(newline)
|
||||
;; (display 97)(newline)
|
||||
;; (display 98)(newline)
|
||||
;; (display 99)(newline)
|
||||
;; (display 100)(newline)
|
||||
;; (display 101)(newline)
|
||||
;; (display 102)(newline)
|
||||
;; (display 103)(newline)
|
||||
;; (display 104)(newline)
|
||||
;; (display 105)(newline)
|
||||
;; (display 106)(newline)
|
||||
;; (display 107)(newline)
|
||||
;; (display 108)(newline)
|
||||
;; (display 109)(newline)
|
||||
;; (display 110)(newline)
|
||||
;; (display 111)(newline)
|
||||
;; (display 112)(newline)
|
||||
;; (display 113)(newline)
|
||||
;; (display 114)(newline)
|
||||
;; (display 115)(newline)
|
||||
;; (display 116)(newline)
|
||||
;; (display 117)(newline)
|
||||
;; (display 118)(newline)
|
||||
;; (display 119)(newline)
|
||||
;; (display 120)(newline)
|
||||
;; (display 121)(newline)
|
||||
;; (display 122)(newline)
|
||||
;; (display 123)(newline)
|
||||
;; (display 124)(newline)
|
||||
;; (display 125)(newline)
|
||||
;; (display 126)(newline)
|
||||
;; (display 127)(newline)
|
||||
;; (display 128)(newline)
|
||||
;; (display 129)(newline)
|
||||
;; (display 130)(newline)
|
||||
;; (display 131)(newline)
|
||||
;; (display 132)(newline)
|
||||
;; (display 133)(newline)
|
||||
;; (display 134)(newline)
|
||||
;; (display 135)(newline)
|
||||
;; (display 136)(newline)
|
||||
;; (display 137)(newline)
|
||||
;; (display 138)(newline)
|
||||
;; (display 139)(newline)
|
||||
;; (display 140)(newline)
|
||||
;; (display 141)(newline)
|
||||
;; (display 142)(newline)
|
||||
;; (display 143)(newline)
|
||||
;; (display 144)(newline)
|
||||
;; (display 145)(newline)
|
||||
;; (display 146)(newline)
|
||||
;; (display 147)(newline)
|
||||
;; (display 148)(newline)
|
||||
;; (display 149)(newline)
|
||||
;; (display 150)(newline)
|
||||
;; (display 151)(newline)
|
||||
;; (display 152)(newline)
|
||||
;; (display 153)(newline)
|
||||
;; (display 154)(newline)
|
||||
;; (display 155)(newline)
|
||||
;; (display 156)(newline)
|
||||
;; (display 157)(newline)
|
||||
;; (display 158)(newline)
|
||||
;; (display 159)(newline)
|
||||
;; (display 160)(newline)
|
||||
;; (display 161)(newline)
|
||||
;; (display 162)(newline)
|
||||
;; (display 163)(newline)
|
||||
;; (display 164)(newline)
|
||||
;; (display 165)(newline)
|
||||
;; (display 166)(newline)
|
||||
;; (display 167)(newline)
|
||||
;; (display 168)(newline)
|
||||
;; (display 169)(newline)
|
||||
;; (display 170)(newline)
|
||||
;; (display 171)(newline)
|
||||
;; (display 172)(newline)
|
||||
;; (display 173)(newline)
|
||||
;; (display 174)(newline)
|
||||
;; (display 175)(newline)
|
||||
;; (display 176)(newline)
|
||||
;; (display 177)(newline)
|
||||
;; (display 178)(newline)
|
||||
;; (display 179)(newline)
|
||||
;; (display 180)(newline)
|
||||
;; (display 181)(newline)
|
||||
;; (display 182)(newline)
|
||||
;; (display 183)(newline)
|
||||
;; (display 184)(newline)
|
||||
;; (display 185)(newline)
|
||||
;; (display 186)(newline)
|
||||
;; (display 187)(newline)
|
||||
;; (display 188)(newline)
|
||||
;; (display 189)(newline)
|
||||
;; (display 190)(newline)
|
||||
;; (display 191)(newline)
|
||||
;; (display 192)(newline)
|
||||
;; (display 193)(newline)
|
||||
;; (display 194)(newline)
|
||||
;; (display 195)(newline)
|
||||
;; (display 196)(newline)
|
||||
;; (display 197)(newline)
|
||||
;; (display 198)(newline)
|
||||
;; (display 199)(newline)
|
||||
;; (display 200)(newline)
|
324
tests/gc-2a.test
324
tests/gc-2a.test
|
@ -1,324 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;; (cons 0 1)
|
||||
;; (display 1)(newline)
|
||||
|
||||
(define (blup?)
|
||||
#t)
|
||||
(blup?)
|
||||
|
||||
(define a 'a)
|
||||
(display a)
|
||||
(display 2)(newline)
|
||||
(display 3)(newline)
|
||||
(display 4)(newline)
|
||||
(display 5)(newline)
|
||||
(display 6)(newline)
|
||||
(display 7)(newline)
|
||||
(display 8)(newline)
|
||||
(display 9)(newline)
|
||||
|
||||
(define *top-define-a* '*top-define-a*)
|
||||
(display (eq? *top-define-a* '*top-define-a*))
|
||||
(newline)
|
||||
(begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
(display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
(newline)
|
||||
|
||||
(define (blup?) #t)
|
||||
(display 'HALLO) (newline)
|
||||
(blup?)
|
||||
(define *top-define-a* '*top-define-a*)
|
||||
(define *top-define-b* '*top-define-b*)
|
||||
(display (eq? *top-define-a* '*top-define-a*))
|
||||
(newline)
|
||||
|
||||
(display 'HALLO2) (newline)
|
||||
|
||||
(define (bla? x y) (eq? x y))
|
||||
|
||||
(begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
(display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
(newline)
|
||||
|
||||
(display 'HALLO3) (newline)
|
||||
|
||||
(display "OKAY\n")
|
||||
|
||||
(define (m x) (* 2 x))
|
||||
(display 'multiply:)
|
||||
(display (m 1)) (newline)
|
||||
(display (m 2)) (newline)
|
||||
(display (m 3)) (newline)
|
||||
(display (m 4)) (newline)
|
||||
|
||||
(define (result r)
|
||||
(display 'result:) (display r) (newline))
|
||||
|
||||
(define-macro (pass-if name t)
|
||||
(list
|
||||
'begin
|
||||
(list display ''xxxtest:) (list display name)
|
||||
(list result t)))
|
||||
|
||||
(display 'foo-test:) (newline)
|
||||
(display 1)(newline)
|
||||
(display 2)(newline)
|
||||
(display 3)(newline)
|
||||
(display 4)(newline)
|
||||
(display 5)(newline)
|
||||
(display 6)(newline)
|
||||
(display 7)(newline)
|
||||
(display 8)(newline)
|
||||
(display 9)(newline)
|
||||
|
||||
(pass-if "if" (eq? (if #t 'true) 'true))
|
||||
(pass-if "if 2" (eq? (if #f #f) *unspecified*))
|
||||
(pass-if "if 3" (eq? (if (eq? 0 '0) 'true 'false) 'true))
|
||||
(pass-if "if 4" (eq? (if (= 1 2) 'true 'false) 'false))
|
||||
|
||||
;; (display 10)(newline)
|
||||
;; (display 11)(newline)
|
||||
;; (display 12)(newline)
|
||||
;; (display 13)(newline)
|
||||
;; (display 14)(newline)
|
||||
;; (display 15)(newline)
|
||||
;; (display 16)(newline)
|
||||
;; (display 17)(newline)
|
||||
;; (display 18)(newline)
|
||||
;; (display 19)(newline)
|
||||
|
||||
;; (display 14)(newline)
|
||||
;; (display 15)(newline)
|
||||
;; (display 16)(newline)
|
||||
;; (display 17)(newline)
|
||||
;; (display 18)(newline)
|
||||
;; (display 19)(newline)
|
||||
|
||||
;; (define (result r)
|
||||
;; (display 'result:) (display r) (newline))
|
||||
|
||||
;; (define-macro (pass-if name t)
|
||||
;; (list
|
||||
;; 'begin
|
||||
;; (list display ''xxxtest:) (list display name)
|
||||
;; (list result t)))
|
||||
|
||||
;; (pass-if 'first-dummy: #t)
|
||||
|
||||
;; (display 20)(newline)
|
||||
;; (display 21)(newline)
|
||||
;; (display 22)(newline)
|
||||
;; (display 23)(newline)
|
||||
;; (display 24)(newline)
|
||||
;; (display 25)(newline)
|
||||
;; (display 26)(newline)
|
||||
;; (display 27)(newline)
|
||||
;; (display 28)(newline)
|
||||
;; (display 29)(newline)
|
||||
;; (display 30)(newline)
|
||||
|
||||
;; (define *top-define-a* '*top-define-a*)
|
||||
;; (display (eq? *top-define-a* '*top-define-a*))
|
||||
;; (newline)
|
||||
;; (begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (newline)
|
||||
|
||||
;; (display 31)(newline)
|
||||
;; (display 32)(newline)
|
||||
;; (display 33)(newline)
|
||||
;; (display 34)(newline)
|
||||
;; (display 35)(newline)
|
||||
;; (display 36)(newline)
|
||||
;; (display 37)(newline)
|
||||
;; (display 38)(newline)
|
||||
;; (display 39)(newline)
|
||||
;; (display 40)(newline)
|
||||
|
||||
;; (display 41)(newline)
|
||||
;; (display 42)(newline)
|
||||
;; (display 43)(newline)
|
||||
;; (display 44)(newline)
|
||||
;; (display 45)(newline)
|
||||
;; (display 46)(newline)
|
||||
;; (display 47)(newline)
|
||||
;; (display 48)(newline)
|
||||
;; (display 49)(newline)
|
||||
;; (display 50)(newline)
|
||||
;; (display 51)(newline)
|
||||
;; (display 52)(newline)
|
||||
;; (display 53)(newline)
|
||||
;; (display 54)(newline)
|
||||
;; (display 55)(newline)
|
||||
;; (display 56)(newline)
|
||||
;; (display 57)(newline)
|
||||
;; (display 58)(newline)
|
||||
;; (display 59)(newline)
|
||||
;; (display 60)(newline)
|
||||
;; (display 61)(newline)
|
||||
;; (display 62)(newline)
|
||||
;; (display 63)(newline)
|
||||
;; (display 64)(newline)
|
||||
;; (display 65)(newline)
|
||||
;; (display 66)(newline)
|
||||
;; (display 67)(newline)
|
||||
;; (display 68)(newline)
|
||||
;; (display 69)(newline)
|
||||
;; (display 70)(newline)
|
||||
;; (display 71)(newline)
|
||||
;; (display 72)(newline)
|
||||
;; (display 73)(newline)
|
||||
;; (display 74)(newline)
|
||||
;; (display 75)(newline)
|
||||
;; (display 76)(newline)
|
||||
;; (display 77)(newline)
|
||||
;; (display 78)(newline)
|
||||
;; (display 79)(newline)
|
||||
;; (display 80)(newline)
|
||||
;; (display 81)(newline)
|
||||
;; (display 82)(newline)
|
||||
;; (display 83)(newline)
|
||||
;; (display 84)(newline)
|
||||
;; (display 85)(newline)
|
||||
;; (display 86)(newline)
|
||||
;; (display 87)(newline)
|
||||
;; (display 88)(newline)
|
||||
;; (display 89)(newline)
|
||||
;; (display 90)(newline)
|
||||
;; (display 91)(newline)
|
||||
;; (display 92)(newline)
|
||||
;; (display 93)(newline)
|
||||
;; (display 94)(newline)
|
||||
;; (display 95)(newline)
|
||||
;; (display 96)(newline)
|
||||
;; (display 97)(newline)
|
||||
;; (display 98)(newline)
|
||||
;; (display 99)(newline)
|
||||
;; (display 100)(newline)
|
||||
;; (display 101)(newline)
|
||||
;; (display 102)(newline)
|
||||
;; (display 103)(newline)
|
||||
;; (display 104)(newline)
|
||||
;; (display 105)(newline)
|
||||
;; (display 106)(newline)
|
||||
;; (display 107)(newline)
|
||||
;; (display 108)(newline)
|
||||
;; (display 109)(newline)
|
||||
;; (display 110)(newline)
|
||||
;; (display 111)(newline)
|
||||
;; (display 112)(newline)
|
||||
;; (display 113)(newline)
|
||||
;; (display 114)(newline)
|
||||
;; (display 115)(newline)
|
||||
;; (display 116)(newline)
|
||||
;; (display 117)(newline)
|
||||
;; (display 118)(newline)
|
||||
;; (display 119)(newline)
|
||||
;; (display 120)(newline)
|
||||
;; (display 121)(newline)
|
||||
;; (display 122)(newline)
|
||||
;; (display 123)(newline)
|
||||
;; (display 124)(newline)
|
||||
;; (display 125)(newline)
|
||||
;; (display 126)(newline)
|
||||
;; (display 127)(newline)
|
||||
;; (display 128)(newline)
|
||||
;; (display 129)(newline)
|
||||
;; (display 130)(newline)
|
||||
;; (display 131)(newline)
|
||||
;; (display 132)(newline)
|
||||
;; (display 133)(newline)
|
||||
;; (display 134)(newline)
|
||||
;; (display 135)(newline)
|
||||
;; (display 136)(newline)
|
||||
;; (display 137)(newline)
|
||||
;; (display 138)(newline)
|
||||
;; (display 139)(newline)
|
||||
;; (display 140)(newline)
|
||||
;; (display 141)(newline)
|
||||
;; (display 142)(newline)
|
||||
;; (display 143)(newline)
|
||||
;; (display 144)(newline)
|
||||
;; (display 145)(newline)
|
||||
;; (display 146)(newline)
|
||||
;; (display 147)(newline)
|
||||
;; (display 148)(newline)
|
||||
;; (display 149)(newline)
|
||||
;; (display 150)(newline)
|
||||
;; (display 151)(newline)
|
||||
;; (display 152)(newline)
|
||||
;; (display 153)(newline)
|
||||
;; (display 154)(newline)
|
||||
;; (display 155)(newline)
|
||||
;; (display 156)(newline)
|
||||
;; (display 157)(newline)
|
||||
;; (display 158)(newline)
|
||||
;; (display 159)(newline)
|
||||
;; (display 160)(newline)
|
||||
;; (display 161)(newline)
|
||||
;; (display 162)(newline)
|
||||
;; (display 163)(newline)
|
||||
;; (display 164)(newline)
|
||||
;; (display 165)(newline)
|
||||
;; (display 166)(newline)
|
||||
;; (display 167)(newline)
|
||||
;; (display 168)(newline)
|
||||
;; (display 169)(newline)
|
||||
;; (display 170)(newline)
|
||||
;; (display 171)(newline)
|
||||
;; (display 172)(newline)
|
||||
;; (display 173)(newline)
|
||||
;; (display 174)(newline)
|
||||
;; (display 175)(newline)
|
||||
;; (display 176)(newline)
|
||||
;; (display 177)(newline)
|
||||
;; (display 178)(newline)
|
||||
;; (display 179)(newline)
|
||||
;; (display 180)(newline)
|
||||
;; (display 181)(newline)
|
||||
;; (display 182)(newline)
|
||||
;; (display 183)(newline)
|
||||
;; (display 184)(newline)
|
||||
;; (display 185)(newline)
|
||||
;; (display 186)(newline)
|
||||
;; (display 187)(newline)
|
||||
;; (display 188)(newline)
|
||||
;; (display 189)(newline)
|
||||
;; (display 190)(newline)
|
||||
;; (display 191)(newline)
|
||||
;; (display 192)(newline)
|
||||
;; (display 193)(newline)
|
||||
;; (display 194)(newline)
|
||||
;; (display 195)(newline)
|
||||
;; (display 196)(newline)
|
||||
;; (display 197)(newline)
|
||||
;; (display 198)(newline)
|
||||
;; (display 199)(newline)
|
||||
;; (display 200)(newline)
|
241
tests/gc-3.test
241
tests/gc-3.test
|
@ -1,241 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;; (define *top-define-a* '*top-define-a*)
|
||||
;; (display (eq? *top-define-a* '*top-define-a*))
|
||||
;; (newline)
|
||||
;; (begin (define *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (display (eq? *top-begin-define-a* '*top-begin-define-a*))
|
||||
;; (newline)
|
||||
|
||||
;; (display 'HALLO) (newline)
|
||||
;; (display 'foo-test:) (newline)
|
||||
(display 1)(newline)
|
||||
(display 2)(newline)
|
||||
(display 3)(newline)
|
||||
(display 4)(newline)
|
||||
(display 5)(newline)
|
||||
(display 6)(newline)
|
||||
(display 7)(newline)
|
||||
(display 8)(newline)
|
||||
(display 9)(newline)
|
||||
|
||||
(display 10)(newline)
|
||||
(display 11)(newline)
|
||||
(display 12)(newline)
|
||||
(display 13)(newline)
|
||||
(display 14)(newline)
|
||||
(display 15)(newline)
|
||||
(display 16)(newline)
|
||||
(display 17)(newline)
|
||||
(display 18)(newline)
|
||||
(display 19)(newline)
|
||||
|
||||
;; (display 20)(newline)
|
||||
;; (display 21)(newline)
|
||||
;; (display 22)(newline)
|
||||
;; (display 23)(newline)
|
||||
;; (display 24)(newline)
|
||||
;; (display 25)(newline)
|
||||
;; (display 26)(newline)
|
||||
;; (display 27)(newline)
|
||||
;; (display 28)(newline)
|
||||
;; (display 29)(newline)
|
||||
;; (display 30)(newline)
|
||||
|
||||
;; (display 31)(newline)
|
||||
;; (display 32)(newline)
|
||||
;; (display 33)(newline)
|
||||
;; (display 34)(newline)
|
||||
;; (display 35)(newline)
|
||||
;; (display 36)(newline)
|
||||
;; (display 37)(newline)
|
||||
;; (display 38)(newline)
|
||||
;; (display 39)(newline)
|
||||
;; (display 40)(newline)
|
||||
|
||||
;; (display 41)(newline)
|
||||
;; (display 42)(newline)
|
||||
;; (display 43)(newline)
|
||||
;; (display 44)(newline)
|
||||
;; (display 45)(newline)
|
||||
;; (display 46)(newline)
|
||||
;; (display 47)(newline)
|
||||
;; (display 48)(newline)
|
||||
;; (display 49)(newline)
|
||||
;; (display 50)(newline)
|
||||
;; (display 51)(newline)
|
||||
;; (display 52)(newline)
|
||||
;; (display 53)(newline)
|
||||
;; (display 54)(newline)
|
||||
;; (display 55)(newline)
|
||||
;; (display 56)(newline)
|
||||
;; (display 57)(newline)
|
||||
;; (display 58)(newline)
|
||||
;; (display 59)(newline)
|
||||
;; (display 60)(newline)
|
||||
;; (display 61)(newline)
|
||||
;; (display 62)(newline)
|
||||
;; (display 63)(newline)
|
||||
;; (display 64)(newline)
|
||||
;; (display 65)(newline)
|
||||
;; (display 66)(newline)
|
||||
;; (display 67)(newline)
|
||||
;; (display 68)(newline)
|
||||
;; (display 69)(newline)
|
||||
;; (display 70)(newline)
|
||||
;; (display 71)(newline)
|
||||
;; (display 72)(newline)
|
||||
;; (display 73)(newline)
|
||||
;; (display 74)(newline)
|
||||
;; (display 75)(newline)
|
||||
;; (display 76)(newline)
|
||||
;; (display 77)(newline)
|
||||
;; (display 78)(newline)
|
||||
;; (display 79)(newline)
|
||||
;; (display 80)(newline)
|
||||
;; (display 81)(newline)
|
||||
;; (display 82)(newline)
|
||||
;; (display 83)(newline)
|
||||
;; (display 84)(newline)
|
||||
;; (display 85)(newline)
|
||||
;; (display 86)(newline)
|
||||
;; (display 87)(newline)
|
||||
;; (display 88)(newline)
|
||||
;; (display 89)(newline)
|
||||
;; (display 90)(newline)
|
||||
;; (display 91)(newline)
|
||||
;; (display 92)(newline)
|
||||
;; (display 93)(newline)
|
||||
;; (display 94)(newline)
|
||||
;; (display 95)(newline)
|
||||
;; (display 96)(newline)
|
||||
;; (display 97)(newline)
|
||||
;; (display 98)(newline)
|
||||
;; (display 99)(newline)
|
||||
;; (display 100)(newline)
|
||||
;; (display 101)(newline)
|
||||
;; (display 102)(newline)
|
||||
;; (display 103)(newline)
|
||||
;; (display 104)(newline)
|
||||
;; (display 105)(newline)
|
||||
;; (display 106)(newline)
|
||||
;; (display 107)(newline)
|
||||
;; (display 108)(newline)
|
||||
;; (display 109)(newline)
|
||||
;; (display 110)(newline)
|
||||
;; (display 111)(newline)
|
||||
;; (display 112)(newline)
|
||||
;; (display 113)(newline)
|
||||
;; (display 114)(newline)
|
||||
;; (display 115)(newline)
|
||||
;; (display 116)(newline)
|
||||
;; (display 117)(newline)
|
||||
;; (display 118)(newline)
|
||||
;; (display 119)(newline)
|
||||
;; (display 120)(newline)
|
||||
;; (display 121)(newline)
|
||||
;; (display 122)(newline)
|
||||
;; (display 123)(newline)
|
||||
;; (display 124)(newline)
|
||||
;; (display 125)(newline)
|
||||
;; (display 126)(newline)
|
||||
;; (display 127)(newline)
|
||||
;; (display 128)(newline)
|
||||
;; (display 129)(newline)
|
||||
;; (display 130)(newline)
|
||||
;; (display 131)(newline)
|
||||
;; (display 132)(newline)
|
||||
;; (display 133)(newline)
|
||||
;; (display 134)(newline)
|
||||
;; (display 135)(newline)
|
||||
;; (display 136)(newline)
|
||||
;; (display 137)(newline)
|
||||
;; (display 138)(newline)
|
||||
;; (display 139)(newline)
|
||||
;; (display 140)(newline)
|
||||
;; (display 141)(newline)
|
||||
;; (display 142)(newline)
|
||||
;; (display 143)(newline)
|
||||
;; (display 144)(newline)
|
||||
;; (display 145)(newline)
|
||||
;; (display 146)(newline)
|
||||
;; (display 147)(newline)
|
||||
;; (display 148)(newline)
|
||||
;; (display 149)(newline)
|
||||
;; (display 150)(newline)
|
||||
;; (display 151)(newline)
|
||||
;; (display 152)(newline)
|
||||
;; (display 153)(newline)
|
||||
;; (display 154)(newline)
|
||||
;; (display 155)(newline)
|
||||
;; (display 156)(newline)
|
||||
;; (display 157)(newline)
|
||||
;; (display 158)(newline)
|
||||
;; (display 159)(newline)
|
||||
;; (display 160)(newline)
|
||||
;; (display 161)(newline)
|
||||
;; (display 162)(newline)
|
||||
;; (display 163)(newline)
|
||||
;; (display 164)(newline)
|
||||
;; (display 165)(newline)
|
||||
;; (display 166)(newline)
|
||||
;; (display 167)(newline)
|
||||
;; (display 168)(newline)
|
||||
;; (display 169)(newline)
|
||||
;; (display 170)(newline)
|
||||
;; (display 171)(newline)
|
||||
;; (display 172)(newline)
|
||||
;; (display 173)(newline)
|
||||
;; (display 174)(newline)
|
||||
;; (display 175)(newline)
|
||||
;; (display 176)(newline)
|
||||
;; (display 177)(newline)
|
||||
;; (display 178)(newline)
|
||||
;; (display 179)(newline)
|
||||
;; (display 180)(newline)
|
||||
;; (display 181)(newline)
|
||||
;; (display 182)(newline)
|
||||
;; (display 183)(newline)
|
||||
;; (display 184)(newline)
|
||||
;; (display 185)(newline)
|
||||
;; (display 186)(newline)
|
||||
;; (display 187)(newline)
|
||||
;; (display 188)(newline)
|
||||
;; (display 189)(newline)
|
||||
;; (display 190)(newline)
|
||||
;; (display 191)(newline)
|
||||
;; (display 192)(newline)
|
||||
;; (display 193)(newline)
|
||||
;; (display 194)(newline)
|
||||
;; (display 195)(newline)
|
||||
;; (display 196)(newline)
|
||||
;; (display 197)(newline)
|
||||
;; (display 198)(newline)
|
||||
;; (display 199)(newline)
|
||||
;; (display 200)(newline)
|
|
@ -1,39 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $(dirname $0)/..//mes "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define v #(0 1 2))
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $(dirname $0)/..//mes "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define v (values 0 1 2))
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
||||
(gc)
|
||||
(display "v: ") (display v) (newline)
|
|
@ -1,48 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $(dirname $0)/..//mes "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
(define (cwv)
|
||||
(display "cwvf=") (display call-with-values-env) (newline)
|
||||
(call-with-values (lambda () (values 1 2 3))
|
||||
(lambda (a b c) (+ a b c))))
|
||||
(display "cwv:") (display cwv) (newline)
|
||||
(display "cdr cwv:") (display (cdr cwv)) (newline)
|
||||
(display "(cwv):") (display (cwv)) (newline)
|
||||
;;(display "current-module:") (display (current-module)) (newline)
|
||||
(gc)
|
||||
(display "cwv:") (display cwv) (newline)
|
||||
(display "cdr cwv:") (display (cdr cwv)) (newline)
|
||||
;;(display "current-module:") (display (current-module)) (newline)
|
||||
(display "(cwv):") (display (cwv)) (newline)
|
||||
(gc)
|
||||
(display "cwv:") (display cwv) (newline)
|
||||
(display "cdr cwv:") (display (cdr cwv)) (newline)
|
||||
(display "(cwv):") (display (cwv call-with-values-env)) (newline)
|
||||
(gc)
|
||||
'dun
|
166
tests/gc.test
166
tests/gc.test
|
@ -1,166 +0,0 @@
|
|||
#! /bin/sh
|
||||
# -*-scheme-*-
|
||||
MES=${MES-$(dirname $0)/../scripts/mes}
|
||||
echo ' ()' | cat $(dirname $0)/../module/mes/base-0.mes $0 /dev/stdin | $MES $MES_FLAGS "$@"
|
||||
#paredit:||
|
||||
exit $?
|
||||
!#
|
||||
|
||||
;;; -*-scheme-*-
|
||||
|
||||
;;; Mes --- Maxwell Equations of Software
|
||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of Mes.
|
||||
;;;
|
||||
;;; Mes is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; Mes is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(mes-use-module (mes base))
|
||||
(mes-use-module (mes quasiquote))
|
||||
(mes-use-module (mes let))
|
||||
(mes-use-module (srfi srfi-0))
|
||||
(mes-use-module (mes scm))
|
||||
(mes-use-module (mes test))
|
||||
|
||||
(pass-if "first dummy" #t)
|
||||
(pass-if-not "second dummy" #f)
|
||||
|
||||
(define gc-size 10)
|
||||
(define the-cells (make-vector gc-size))
|
||||
(define gc-free 0)
|
||||
|
||||
(define cell-type-alist
|
||||
'((0 . c) (1 . m) (2 . n) (3 . p) (4 . i) (5 . $) (6 . s) (7 . r)))
|
||||
|
||||
(define (cell-index c)
|
||||
(if (eq? (car c) 'p)
|
||||
(cdr c)))
|
||||
|
||||
(define (describe-cell c)
|
||||
(cons (assoc-ref cell-type-alist (mes-type-of c)) c))
|
||||
|
||||
(define (iota n)
|
||||
(if (= 0 n) '(0)
|
||||
(append (iota (- n 1)) (list n))))
|
||||
|
||||
(define (gc-show)
|
||||
(display "\nfree:") (display gc-free) (newline)
|
||||
(map (lambda (i) (display i) (display ": ") (display (describe-cell (vector-ref the-cells i))) (newline)) (iota (- gc-size 1))))
|
||||
|
||||
(define (gc-show-new)
|
||||
(display "new:\n")
|
||||
(map (lambda (i) (display i) (display ": ") (display (describe-cell (vector-ref new-cells i))) (newline)) (iota (- gc-size 1)))
|
||||
)
|
||||
(gc-show)
|
||||
|
||||
(define (gc)
|
||||
(gc-show)
|
||||
barf-gc)
|
||||
|
||||
(define (alloc)
|
||||
(if (= gc-free gc-size) (gc))
|
||||
((lambda (index)
|
||||
(set! gc-free (+ gc-free 1))
|
||||
(core:make-cell 'p index))
|
||||
gc-free))
|
||||
|
||||
(define (core:make-cell type . x)
|
||||
(cons type (if (pair? x) (car x) '*)))
|
||||
|
||||
(define (cell-index c)
|
||||
(if (eq? (car c) 'p)
|
||||
(cdr c)))
|
||||
|
||||
(define (make-number x)
|
||||
((lambda (cell)
|
||||
(vector-set! the-cells (cell-index cell) x)
|
||||
cell)
|
||||
(alloc)))
|
||||
|
||||
(define (make-symbol x)
|
||||
((lambda (cell)
|
||||
(vector-set! the-cells (cell-index cell) x)
|
||||
cell)
|
||||
(alloc)))
|
||||
|
||||
(define (gc-cons x y)
|
||||
((lambda (cell)
|
||||
((lambda (pair)
|
||||
(vector-set! the-cells (cell-index cell) pair)
|
||||
(set-car! pair x)
|
||||
(set-cdr! pair y))
|
||||
(cons *unspecified* *unspecified*))
|
||||
cell)
|
||||
(alloc)))
|
||||
|
||||
;; (define (gc-reg c)
|
||||
;; (vector-ref the-cells (cell-index c)))
|
||||
|
||||
(define gc-display display)
|
||||
;;(define (gc-display c) (display (gc-reg c)))
|
||||
;; (define (gc-car c) (car (gc-reg c)))
|
||||
;; (define (gc-cdr c) (cdr (gc-reg c)))
|
||||
;; (define (gc-pair? c) (pair? (gc-reg c)))
|
||||
;; (define (gc-null? c) (null? (gc-reg c)))
|
||||
;; (define (gc-display x . cont?)
|
||||
;; (if (gc-pair? x) (begin (if (null? cont?) (display "("))
|
||||
;; (gc-display (gc-reg x))
|
||||
;; (if (gc-pair? (gc-cdr x)) (display " "))
|
||||
;; (if (not (gc-null? (gc-cdr x)))
|
||||
;; (gc-display (gc-cdr x) #t))
|
||||
;; (if (null? cont?) (display ")")))
|
||||
;; (if (gc-null? x) (if (not cont?) (display "()"))
|
||||
;; (display (gc-reg x)))))
|
||||
|
||||
(define gc-nil '())
|
||||
(define first (make-symbol 'F)) (newline)
|
||||
|
||||
(define one (make-number 1))
|
||||
(display "one=") (display one) (newline)
|
||||
(define two (make-number 2))
|
||||
(define pair2-nil (gc-cons two gc-nil))
|
||||
(display "pair2-nil=") (display pair2-nil) (newline)
|
||||
(gc-show)
|
||||
|
||||
(define list1-2 (gc-cons one pair2-nil))
|
||||
(display "list1-2=") (display list1-2) (newline)
|
||||
(gc-show)
|
||||
|
||||
(define three (make-number 3))
|
||||
(define four (make-number 4))
|
||||
(define pair4-nil (gc-cons four gc-nil))
|
||||
(define list3-4 (gc-cons three pair4-nil))
|
||||
(define list1234 (gc-cons list1-2 list3-4))
|
||||
(gc-show)
|
||||
|
||||
(display "list1-2=") (display list1-2) (newline)
|
||||
(display "list3-4=") (display list3-4) (newline)
|
||||
(display "lst=") (display list1234) (newline)
|
||||
(gc-show)
|
||||
|
||||
(display "sicp-lst:") (gc-display list1234) (newline)
|
||||
(gc-show)
|
||||
|
||||
(display "\n**** trigger gc ****\n")
|
||||
(define next (gc-list (make-symbol 'N) (make-symbol 'X)))
|
||||
(set! list1234 '(p . 0))
|
||||
(display "sicp-lst:") (gc-display list1234) (newline)
|
||||
(gc-show)
|
||||
(display "next=") (display next) (newline)
|
||||
(display "gc-next=") (gc-display next) (newline)
|
||||
(gc-show)
|
||||
|
||||
|
||||
|
||||
(result 'report)
|
Loading…
Reference in a new issue