소스 검색

moved REDIRECT to this file

Mark VandenBrink 12 년 전
부모
커밋
ec29820dde
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      utils.lisp

+ 6 - 0
utils.lisp

@@ -42,3 +42,9 @@ to see if it matches. PATHNAME version."
     (if e
       (string= (string-downcase e) (string-downcase ext))
       nil)))
+
+(defmacro redirect (filename &rest body)
+  "Temporarily set *STANDARD-OUTPUT* to FILENAME and execute BODY."
+  `(let ((*standard-output* (open ,filename :direction :output :if-does-not-exist :create :if-exists :supersede)))
+     ,@body
+     (finish-output *standard-output*)))