1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: console.lisp
6 ;;;; Purpose: Console interactiion
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Dec 2002
10 ;;;; $Id: console.lisp,v 1.1 2002/12/13 21:59:57 kevin Exp $
12 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;; and by onShore Development, Inc.
15 ;;;; KMRCL users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
22 (defvar *console-msgs* t)
24 (defvar *console-msgs-types* nil)
26 (defun cmsg (template &rest args)
27 "Format output to console"
29 (setq template (concatenate 'string "~&;; " template "~%"))
30 (apply #'format t template args))
33 (defun cmsg-c (condition template &rest args)
34 "Push CONDITION keywords into *console-msgs-types* to print console msgs
35 for that CONDITION. TEMPLATE and ARGS function identically to
36 (format t TEMPLATE ARGS) "
37 (when (or (member :verbose *console-msgs-types*)
38 (member condition *console-msgs-types*))
39 (apply #'cmsg template args)))
41 (defun cmsg-add (condition)
42 (pushnew condition *console-msgs-types*))
44 (defun cmsg-remove (condition)
45 (setf *console-msgs-types* (remove condition *console-msgs-types*)))
47 (defun fixme (template &rest args)
48 "Format output to console"
49 (setq template (concatenate 'string "~&;; ** FIXME ** " template "~%"))
50 (apply #'format t template args)