www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit bc8dedf65248efed9adced52b1741757e74b43db
parent 2e3ce256f3d339a75827c9238887f61c520e012f
Author: Bertrand BRUN <bertrand.brun@me.com>
Date:   Fri,  5 Nov 2010 22:05:59 +0100

Ajout des fonctions get-defun, get-defmacro, set-defun et set-defmacro dans util.lisp + correction du readfile + ajout du corps de la fonction m-macroexpand-1

Diffstat:
Mlisp2li.lisp | 17-----------------
Mutil.lisp | 32+++++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/lisp2li.lisp b/lisp2li.lisp @@ -11,23 +11,6 @@ (defun map-lisp2li (expr env) (mapcar (lambda (x) (lisp2li x env)) expr)) -(defun m-macroexpand-1 (macro) - ()) - -(defmacro get-defun (symb) - `(get ,symb :defun)) - -(defun set-defun (li) - (setf (get-defun (cdaddr li)) - (cdddr li))) - -(defmacro get-defmacro (symb) - `(get ,symb :defmacro)) - -(defun set-defmacro (li) - (setf (get-defmacro (cdaddr li)) - (cdddr li))) - (defun make-stat-env (params &optional env) (append (loop diff --git a/util.lisp b/util.lisp @@ -59,10 +59,28 @@ (defun readfile (name) (let ((fd (open name))) - `(progn - ,(loop - for line = (read fd nil 'eof) - when (not (eq line 'eof)) - do (cons line nil) - else return (close fd) - )))) + (cons 'progn + (loop + for line = (read fd nil 'eof) + while (not (eq line 'eof)) + collect line + finally (close fd) + )))) + +(defun m-macroexpand-1 (macro) + ()) + +(defmacro get-defun (symb) + `(get ,symb :defun)) + +(defun set-defun (li) + (setf (get-defun (cdaddr li)) + (cdddr li))) + +(defmacro get-defmacro (symb) + `(get ,symb :defmacro)) + +(defun set-defmacro (li) + (setf (get-defmacro (cdaddr li)) + (cdddr li))) +