core: Add getenv, verbose module loading on MES_DEBUG.
* mes.c (MAKE_REF, MAKE_STRING): Oops, remove stray semicolon. * posix.c (getenv_): New function. * module/mes/base-0.mes (load): Use it to switch on MES_DEBUG=1. (mes-use-module): Remove commented-out code.
This commit is contained in:
parent
e8d8d5c3be
commit
15163e9dc1
4
mes.c
4
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_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_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n))
|
||||||
#define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0);
|
#define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0)
|
||||||
#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0);
|
#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0)
|
||||||
|
|
||||||
int error (char const* msg, SCM x);
|
int error (char const* msg, SCM x);
|
||||||
SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a);
|
SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a);
|
||||||
|
|
|
@ -108,9 +108,11 @@
|
||||||
'o))
|
'o))
|
||||||
(define-macro (load file)
|
(define-macro (load file)
|
||||||
(list 'begin
|
(list 'begin
|
||||||
(list core:stderr "read ")
|
(list 'if (list getenv "MES_DEBUG")
|
||||||
(list core:stderr file)
|
(list 'begin
|
||||||
(list core:stderr "\n")
|
(list core:stderr "read ")
|
||||||
|
(list core:stderr file)
|
||||||
|
(list core:stderr "\n")))
|
||||||
(list 'push! '*input-ports* (list current-input-port))
|
(list 'push! '*input-ports* (list current-input-port))
|
||||||
(list 'set-current-input-port (list open-input-file file))
|
(list 'set-current-input-port (list open-input-file file))
|
||||||
(list 'primitive-load)
|
(list 'primitive-load)
|
||||||
|
@ -153,9 +155,6 @@
|
||||||
(list
|
(list
|
||||||
'begin
|
'begin
|
||||||
(list 'set! '*modules* (list cons (list string->symbol (module->file module)) '*modules*))
|
(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)))))))
|
(list 'load (list string-append '*mes-prefix* (module->file module)))))))
|
||||||
|
|
||||||
(mes-use-module (srfi srfi-0))
|
(mes-use-module (srfi srfi-0))
|
||||||
|
|
Loading…
Reference in a new issue