;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: cl-symbols.lisp,v 1.3 2002/10/10 16:23:48 kevin Exp $
+;;;; $Id: cl-symbols.lisp,v 1.4 2002/12/13 21:59:57 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(fboundp sym))
(push sym funcs))))
(nreverse funcs)))
+
+;;; Symbol functions
+
+(defun concat-symbol-pkg (pkg &rest args)
+ (declare (dynamic-extent args))
+ (flet ((stringify (arg)
+ (etypecase arg
+ (string
+ (string-upcase arg))
+ (symbol
+ (symbol-name arg)))))
+ (let ((str (apply #'concatenate 'string (mapcar #'stringify args))))
+ (intern #-case-sensitive (string-upcase str)
+ #+case-sensitive str
+ (if pkg pkg *package*)))))
+
+
+(defun concat-symbol (&rest args)
+ (apply #'concat-symbol-pkg nil args))
+
+(defun ensure-keyword (name)
+ "Returns keyword for a name"
+ (etypecase name
+ (keyword name)
+ (string (values (intern
+ #-case-sensitive (string-upcase name)
+ #+case-sensitive name
+ :keyword)))
+ (symbol (values (intern (symbol-name name)) :keyword))))
--- /dev/null
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: console.lisp
+;;;; Purpose: Console interactiion
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Dec 2002
+;;;;
+;;;; $Id: console.lisp,v 1.1 2002/12/13 21:59:57 kevin Exp $
+;;;;
+;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; and by onShore Development, Inc.
+;;;;
+;;;; KMRCL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+;;;; *************************************************************************
+
+(in-package :kmrcl)
+
+(defvar *console-msgs* t)
+
+(defvar *console-msgs-types* nil)
+
+(defun cmsg (template &rest args)
+ "Format output to console"
+ (when *console-msgs*
+ (setq template (concatenate 'string "~&;; " template "~%"))
+ (apply #'format t template args))
+ (values))
+
+(defun cmsg-c (condition template &rest args)
+ "Push CONDITION keywords into *console-msgs-types* to print console msgs
+ for that CONDITION. TEMPLATE and ARGS function identically to
+ (format t TEMPLATE ARGS) "
+ (when (or (member :verbose *console-msgs-types*)
+ (member condition *console-msgs-types*))
+ (apply #'cmsg template args)))
+
+(defun cmsg-add (condition)
+ (pushnew condition *console-msgs-types*))
+
+(defun cmsg-remove (condition)
+ (setf *console-msgs-types* (remove condition *console-msgs-types*)))
+
+(defun fixme (template &rest args)
+ "Format output to console"
+ (setq template (concatenate 'string "~&;; ** FIXME ** " template "~%"))
+ (apply #'format t template args)
+ (values))
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: genutils.lisp,v 1.11 2002/12/04 16:49:23 kevin Exp $
+;;;; $Id: genutils.lisp,v 1.12 2002/12/13 21:59:57 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(terpri ostrm)))
-;;; Symbol functions
-
-(defmacro concat-symbol (&rest args)
- `(intern (concatenate 'string ,@args)))
-
-(defmacro concat-symbol-pkg (pkg &rest args)
- `(intern (concatenate 'string ,@args) ,pkg))
-
-
;;; IO
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: kmrcl.asd,v 1.22 2002/11/25 07:45:36 kevin Exp $
+;;;; $Id: kmrcl.asd,v 1.23 2002/12/13 21:59:57 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(pushnew :kmrcl cl:*features*))
:components
((:file "package")
+ (:file "console" :depends-on ("package"))
(:file "genutils" :depends-on ("package"))
(:file "strings" :depends-on ("package"))
(:file "equal" :depends-on ("package"))
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: package.lisp,v 1.15 2002/12/04 16:49:23 kevin Exp $
+;;;; $Id: package.lisp,v 1.16 2002/12/13 21:59:57 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
#:indent-spaces
#:print-list
#:print-rows
- #:concat-symbol
- #:concat-symbol-pkg
#:file-subst
#:stream-subst
#:remove-tree-if
#:in
#:mean
#:with-gensyms
-
+
+ ;; symbols.lisp
+ #:ensure-keyword
+ #:concat-symbol
+ #:concat-symbol-pkg
+
;; From attrib-class.lisp
#:attributes-class
#:slot-attribute
#:xml-tag-contents
#:positions-xml-tag-contents
#:xml-cdata
+
+ ;; From console
+ *console-msgs*
+ cmsg
+ cmsg-c
+ cmsg-add
+ cmsg-remove
+ fixme
))