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:
parent
2e3ce256f3
commit
bc8dedf652
17
lisp2li.lisp
17
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
|
||||
|
|
32
util.lisp
32
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)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user