core: Remove append.

* lib.c (append): Remove.
* scaffold/mini-mes.c (append): Remove.
* module/mes/base-0.mes (append): New function.
* module/mes/read-0.mo: Regenerate.
* module/mes/read-0-32.mo: Regenerate.
This commit is contained in:
Jan Nieuwenhuizen 2017-04-02 08:05:55 +02:00
parent 117006cf7c
commit 05cae56813
3 changed files with 7 additions and 18 deletions

8
lib.c
View file

@ -170,14 +170,6 @@ exit_ (SCM x) ///((name . "exit"))
exit (VALUE (x)); 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 //MINI_MES
// char const* // char const*
// string_to_cstring (SCM s) // string_to_cstring (SCM s)

View file

@ -110,6 +110,11 @@
(define-macro (include-from-path file) (define-macro (include-from-path file)
(list 'load (list string-append "module/" 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") (include "module/mes/type-0.mes")
(define (memq x lst) (define (memq x lst)
@ -129,8 +134,8 @@
(define (mes-load-module-env module a) (define (mes-load-module-env module a)
(push! *input-ports* (current-input-port)) (push! *input-ports* (current-input-port))
(set-current-input-port (open-input-file (string-append *mes-prefix* (module->file module)))) (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)) (let ((x (core:eval (append2 (cons 'begin (read-input-file-env a))
'((current-module))) '((current-module)))
a))) a)))
(set-current-input-port (pop! *input-ports*)) (set-current-input-port (pop! *input-ports*))
x)) x))

View file

@ -1441,14 +1441,6 @@ exit_ (SCM x) ///((name . "exit"))
exit (VALUE (x)); 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 SCM
xassq (SCM x, SCM a) ///for speed in core only xassq (SCM x, SCM a) ///for speed in core only
{ {