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

This commit is contained in:
Bertrand BRUN 2010-11-05 22:05:59 +01:00
parent 2e3ce256f3
commit bc8dedf652
2 changed files with 25 additions and 24 deletions

View File

@ -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

View File

@ -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)))