X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fboot.lisp;h=3541b23a863e800e602dc220d4542eb2eba185b3;hb=18ada11fb234e336a3d2ac4370d384d80d36f9f0;hp=d7141f69b987fd3997e4fcc76d2c500d3d63a9fb;hpb=3d1e86f1638c71cfc4d11638dcb6b42cfd30d859;p=jscl.git diff --git a/src/boot.lisp b/src/boot.lisp index d7141f6..3541b23 100644 --- a/src/boot.lisp +++ b/src/boot.lisp @@ -22,6 +22,8 @@ ;;; Lisp world from scratch. This code has to define enough language ;;; to the compiler to be able to run. +(/debug "loading boot.lisp!") + (eval-when-compile (let ((defmacro-macroexpander '#'(lambda (form) @@ -472,14 +474,15 @@ ((null (cddr pairs)) (let ((place (!macroexpand-1 (first pairs))) (value (second pairs))) - (multiple-value-bind (vars vals store-vars writer-form) + (multiple-value-bind (vars vals store-vars writer-form reader-form) (get-setf-expansion place) ;; TODO: Optimize the expansion a little bit to avoid let* ;; or multiple-value-bind when unnecesary. `(let* ,(mapcar #'list vars vals) (multiple-value-bind ,store-vars ,value - ,writer-form))))) + ,writer-form + ,reader-form))))) (t `(progn ,@(do ((pairs pairs (cddr pairs)) @@ -494,7 +497,7 @@ (cond ,@(mapcar (lambda (c) (if (eq (car c) t) - `((t ,@(rest c))) + `(t ,@(rest c)) `((,(ecase (car c) (integer 'integerp) (cons 'consp) @@ -539,3 +542,8 @@ (defun error (fmt &rest args) (%throw (apply #'format nil fmt args))) + +(defmacro nth-value (n form) + `(multiple-value-call (lambda (&rest values) + (nth ,n values)) + ,form))