1475bc2740d2

Shut up
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 16 Sep 2016 13:53:09 +0000
parents 4ce0e524240d
children 6aeaaa9a56bf
branches/tags (none)
files losh.lisp package.lisp

Changes

--- a/losh.lisp	Thu Sep 15 13:59:19 2016 +0000
+++ b/losh.lisp	Fri Sep 16 13:53:09 2016 +0000
@@ -1196,6 +1196,12 @@
   (format stream (format nil "~~~D,'0B" size) (ldb (byte size 0) n))
   (values))
 
+(defmacro shut-up (&body body)
+  "Run `body` with stdout and stderr redirected to the void."
+  `(let ((*standard-output* (make-broadcast-stream))
+         (*error-output* (make-broadcast-stream)))
+    ,@body))
+
 (defmacro dis (arglist &body body)
   "Disassemble the code generated for a `lambda` with `arglist` and `body`.
 
--- a/package.lisp	Thu Sep 15 13:59:19 2016 +0000
+++ b/package.lisp	Fri Sep 16 13:53:09 2016 +0000
@@ -19,8 +19,6 @@
              `(:export ,@(external-symbols parent-package)))))
 
 
-
-
 (defpackage #:losh.math
   (:documentation "Utilities related to math and numbers.")
   (:export
@@ -150,6 +148,7 @@
   (:export
     #:pr
     #:bits
+    #:shut-up
     #:dis))
 
 (defpackage #:losh.weightlists