diff --git a/lib.c b/lib.c index 5d33bb87..b7a636c9 100644 --- a/lib.c +++ b/lib.c @@ -170,14 +170,6 @@ exit_ (SCM x) ///((name . "exit")) exit (VALUE (x)); } -SCM -append (SCM x) ///((arity . n)) -{ - if (x == cell_nil) return cell_nil; - if (cdr (x) == cell_nil) return car (x); - return append2 (car (x), append (cdr (x))); -} - //MINI_MES // char const* // string_to_cstring (SCM s) diff --git a/module/mes/base-0.mes b/module/mes/base-0.mes index 11359fc2..eab39910 100644 --- a/module/mes/base-0.mes +++ b/module/mes/base-0.mes @@ -110,6 +110,11 @@ (define-macro (include-from-path file) (list 'load (list string-append "module/" file))) +(define (append . rest) + (if (null? rest) '() + (if (null? (cdr rest)) (car rest) + (append2 (car rest) (apply append (cdr rest)))))) + (include "module/mes/type-0.mes") (define (memq x lst) @@ -129,8 +134,8 @@ (define (mes-load-module-env module a) (push! *input-ports* (current-input-port)) (set-current-input-port (open-input-file (string-append *mes-prefix* (module->file module)))) - (let ((x (core:eval (append (cons 'begin (read-input-file-env a)) - '((current-module))) + (let ((x (core:eval (append2 (cons 'begin (read-input-file-env a)) + '((current-module))) a))) (set-current-input-port (pop! *input-ports*)) x)) diff --git a/scaffold/mini-mes.c b/scaffold/mini-mes.c index 5d500975..a67277a5 100644 --- a/scaffold/mini-mes.c +++ b/scaffold/mini-mes.c @@ -1441,14 +1441,6 @@ exit_ (SCM x) ///((name . "exit")) exit (VALUE (x)); } -SCM -append (SCM x) ///((arity . n)) -{ - if (x == cell_nil) return cell_nil; - if (cdr (x) == cell_nil) return car (x); - return append2 (car (x), append (cdr (x))); -} - SCM xassq (SCM x, SCM a) ///for speed in core only {