diff --git a/GNUmakefile b/GNUmakefile index 7266df4e..f454d080 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -85,7 +85,7 @@ dump: module/mes/read-0.mo guile-check: set -e; for i in $(TESTS); do\ - guile -s <(cat $(MES-0) module/mes/test.mes $$i);\ + $(GUILE) -s <(cat $(MES-0) module/mes/test.mes $$i);\ done MAIN_C:=doc/examples/main.c diff --git a/guile/mes-0.scm b/guile/mes-0.scm index 64dd3463..9b9076be 100644 --- a/guile/mes-0.scm +++ b/guile/mes-0.scm @@ -27,5 +27,9 @@ (define-macro (mes-use-module . rest) #t) (define builtin? procedure?) ; not strictly true, but ok for tests/*.test +(define mes? (pair? (current-module))) (define guile? (not (pair? (current-module)))) +(define guile-1.8? (equal? (effective-version) "1.8")) +(define guile-2? (and (not mes?) (not guile-1.8?))) +(if guile-1.8? (use-modules (ice-9 syncase))) (define EOF (if #f #f)) diff --git a/module/mes/base-0.mes b/module/mes/base-0.mes index 1cf396a3..28c0c2b4 100644 --- a/module/mes/base-0.mes +++ b/module/mes/base-0.mes @@ -26,7 +26,11 @@ ;;; Code: -#f ;; FIXME -- needed for --dump, then --load +(define (effective-version) "0.3") +(define mes? #t) +(define guile? #f) +(define guile-1.8? #f) +(define guile-2? #f) (define (primitive-eval e) (eval-env e (current-module))) (define eval eval-env) diff --git a/module/mes/base.mes b/module/mes/base.mes index e6b70dd6..7ac4b4d9 100644 --- a/module/mes/base.mes +++ b/module/mes/base.mes @@ -52,8 +52,6 @@ (equal? (vector->list a) (vector->list b)) (eq? a b)))))) -(define guile? (not (pair? (current-module)))) - (define (list? x) (or (null? x) (and (pair? x) (list? (cdr x))))) diff --git a/tests/cwv.test b/tests/cwv.test index bdd450ad..28d673e2 100755 --- a/tests/cwv.test +++ b/tests/cwv.test @@ -28,9 +28,12 @@ exit $? (mes-use-module (mes scm)) (mes-use-module (mes test)) -(pass-if "values" (seq? (values 0 1) 0)) -(pass-if "values 2" (seq? ((lambda (x) x) (values 1 2 3)) 1)) -(pass-if "values 3" (seq? 1 ((lambda (x) x) (values 1 2 3)))) +(if (not guile-1.8?) + (pass-if "values" (seq? (values 0 1) 0))) +(if (not guile-1.8?) + (pass-if "values 2" (seq? ((lambda (x) x) (values 1 2 3)) 1))) +(if (not guile-1.8?) + (pass-if "values 3" (seq? 1 ((lambda (x) x) (values 1 2 3))))) (pass-if "call-with-values" (seq? (call-with-values (lambda () (values 1 2 3)) (lambda (a b c) (+ a b c))) 6))