diff --git a/mes.c b/mes.c index cab98d36..f6d22cce 100644 --- a/mes.c +++ b/mes.c @@ -163,8 +163,8 @@ SCM r3 = 0; // param 3 #define MAKE_CHAR(n) make_cell (tmp_num_ (CHAR), 0, tmp_num2_ (n)) #define MAKE_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n)) -#define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0); -#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0); +#define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0) +#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0) int error (char const* msg, SCM x); SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a); diff --git a/module/mes/base-0.mes b/module/mes/base-0.mes index 5f0ee3c5..609559fe 100644 --- a/module/mes/base-0.mes +++ b/module/mes/base-0.mes @@ -108,9 +108,11 @@ 'o)) (define-macro (load file) (list 'begin - (list core:stderr "read ") - (list core:stderr file) - (list core:stderr "\n") + (list 'if (list getenv "MES_DEBUG") + (list 'begin + (list core:stderr "read ") + (list core:stderr file) + (list core:stderr "\n"))) (list 'push! '*input-ports* (list current-input-port)) (list 'set-current-input-port (list open-input-file file)) (list 'primitive-load) @@ -153,9 +155,6 @@ (list 'begin (list 'set! '*modules* (list cons (list string->symbol (module->file module)) '*modules*)) - ;; (list core:stderr "read ") - ;; (list core:stderr file) - ;; (list core:stderr "\n") (list 'load (list string-append '*mes-prefix* (module->file module))))))) (mes-use-module (srfi srfi-0)) diff --git a/posix.c b/posix.c index 15257c80..5a95ec7e 100644 --- a/posix.c +++ b/posix.c @@ -40,6 +40,13 @@ peekchar () return c; } +SCM +getenv_ (SCM s) ///((name . "getenv")) +{ + char *p = getenv (string_to_cstring (s)); + return p ? MAKE_STRING (cstring_to_list (p)) : cell_f; +} + SCM peek_byte () {