Преглед изворни кода

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*)))