From 13c5b092a0e25edba90dad433b00cba1dd4851fd Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Sat, 6 Dec 2008 01:22:00 +0100 Subject: [PATCH] Rename *DEBUG* to *SAFETY-CHECKS*, add docstring. --- base/debug.lisp | 24 ++++++++++-------------- base/pkgdcl.lisp | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/base/debug.lisp b/base/debug.lisp index d7af259..3c52d85 100644 --- a/base/debug.lisp +++ b/base/debug.lisp @@ -5,26 +5,22 @@ (in-package :iolib.base) -(defparameter *debug* t) +(defparameter *safety-checks* t + "Enables safety checks throught the IOLib codebase. +ACHTUNG!!! Don't disable this unless you're very confident about the quality of the code in IOLib.") (defmacro debug-only (&body body) - (if *debug* - `(progn - ,@body) - (values))) + (when *safety-checks* + `(progn ,@body))) (defmacro debug-only* (&body body) - `(if *debug* - (progn - ,@body) - (values))) + `(when *safety-checks* + (progn ,@body))) (defmacro production-only (&body body) - (if *debug* - (values) - `(progn - ,@body))) + (unless *safety-checks* + `(progn ,@body))) (defmacro production-only* (&body body) - `(unless *debug* + `(unless *safety-checks* ,@body)) diff --git a/base/pkgdcl.lisp b/base/pkgdcl.lisp index 47138ca..030c6bd 100644 --- a/base/pkgdcl.lisp +++ b/base/pkgdcl.lisp @@ -12,7 +12,7 @@ ;; Conditions #:bug ;; Debugging - #:*debug* + #:*safety-checks* #:debug-only #:debug-only* #:production-only #:production-only* ;; Types -- 2.11.4.GIT