[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

with-open-file



     > (macroexpand  '(with-open-file (str "file" :direction :io) (format 
     str "zz")))
     
     (let ((str (open "file" :direction :io)))
       (unwind-protect
         (multiple-value-prog1 (progn (format str "zz")) (when str (close 
     str)))
         (when str (close str :abort t))
     ) ) ;
     t
     > 
     
     why close is done twice?
     Why not just
     (unwind-protect (progn ,@body) (when str (close str :abort t)))
     ?