From: Henry Irvine Date: Sun, 5 May 2013 16:55:59 +0000 (+0900) Subject: add prog macro X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6401376cfce4be41e163eb4c7cd9b848f4f955ec;p=jscl.git add prog macro --- diff --git a/src/boot.lisp b/src/boot.lisp index 8c1d6c2..3ba4fda 100644 --- a/src/boot.lisp +++ b/src/boot.lisp @@ -227,6 +227,12 @@ (defmacro prog2 (form1 result &body body) `(prog1 (progn ,form1 ,result) ,@body)) +(defmacro prog (inits &rest body ) + (multiple-value-bind (forms decls docstring) (parse-body body) + `(block nil + (let ,inits + ,@decls + (tagbody ,@forms))))) ;;; Go on growing the Lisp language in Ecmalisp, with more high level diff --git a/src/toplevel.lisp b/src/toplevel.lisp index fa7c3f1..81315e1 100644 --- a/src/toplevel.lisp +++ b/src/toplevel.lisp @@ -68,7 +68,7 @@ multiple-value-call multiple-value-list multiple-value-prog1 nconc nil ninth not nreconc nth nthcdr null numberp or otherwise package-name package-use-list packagep pairlis parse-integer plusp - pop prin1-to-string print proclaim prog1 prog2 progn psetq push + pop prin1-to-string print proclaim prog prog1 prog2 progn psetq push quote rassoc read-from-string remove remove-if remove-if-not return return-from revappend reverse rplaca rplacd second set setf seventh setq sixth some string string-upcase string= stringp subseq subst