Changeset 11645
 Timestamp:
 02/08/09 14:34:10 (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/abcl/src/org/armedbear/lisp/compilerpass1.lisp
r11644 r11645 142 142 (p1default form))))) 143 143 144 145 (defmacro p1let/let*vars 146 (varlist variablesvar var body1 body2) 147 (let ((varspec (gensym)) 148 (initform (gensym)) 149 (name (gensym))) 150 `(let ((,variablesvar ())) 151 (dolist (,varspec ,varlist) 152 (cond ((consp ,varspec) 153 ;; FIXME Currently this error is signalled by the precompiler. 154 (unless (= (length ,varspec) 2) 155 (compilererror "The LET/LET* binding specification ~S is invalid." 156 ,varspec)) 157 (let* ((,name (%car ,varspec)) 158 (,initform (p1 (%cadr ,varspec))) 159 (,var (makevariable :name (checkname ,name) :initform ,initform))) 160 (push ,var ,variablesvar) 161 ,@body1)) 162 (t 163 (let ((,var (makevariable :name (checkname ,varspec)))) 164 (push ,var ,variablesvar) 165 ,@body1)))) 166 ,@body2))) 167 144 168 (defknown p1letvars (t) t) 145 169 (defun p1letvars (varlist) 146 (let ((vars ())) 147 (dolist (varspec varlist) 148 (cond ((consp varspec) 149 ;; FIXME Currently this error is signalled by the precompiler. 150 (unless (= (length varspec) 2) 151 (compilererror "The LET binding specification ~S is invalid." 152 varspec)) 153 (let ((name (checkname (%car varspec))) 154 (initform (p1 (%cadr varspec)))) 155 (push (makevariable :name name :initform initform) vars))) 156 (t 157 (push (makevariable :name (checkname varspec)) vars)))) 158 (setf vars (nreverse vars)) 170 (p1let/let*vars 171 varlist vars var 172 () 173 ((setf vars (nreverse vars)) 159 174 (dolist (variable vars) 160 175 (push variable *visiblevariables*) 161 176 (push variable *allvariables*)) 162 vars)) 177 vars))) 163 178 164 179 (defknown p1let*vars (t) t) 165 180 (defun p1let*vars (varlist) 166 (let ((vars ())) 167 (dolist (varspec varlist) 168 (cond ((consp varspec) 169 ;; FIXME Currently this error is signalled by the precompiler. 170 (unless (= (length varspec) 2) 171 (compilererror "The LET* binding specification ~S is invalid." 172 varspec)) 173 (let* ((name (%car varspec)) 174 (initform (p1 (%cadr varspec))) 175 (var (makevariable :name (checkname name) :initform initform))) 176 (push var vars) 177 (push var *visiblevariables*) 178 (push var *allvariables*))) 179 (t 180 (let ((var (makevariable :name (checkname varspec)))) 181 (push var vars) 182 (push var *visiblevariables*) 183 (push var *allvariables*))))) 184 (nreverse vars))) 181 (p1let/let*vars 182 varlist vars var 183 ((push var *visiblevariables*) 184 (push var *allvariables*)) 185 ((nreverse vars)))) 185 186 186 187 (defun p1let/let* (form)
Note: See TracChangeset
for help on using the changeset viewer.