1 ;;;;------------------------------------------------------------------
3 ;;;; Copyright (C) 20012000, 2003-2004, Frode Vatved Fjeld
5 ;;;; Filename: utilities.lisp
7 ;;;; Author: Nikodemus Siivola
8 ;;;; Created at: Sun Nov 2 14:51:21 EET 2003
9 ;;;; Distribution: See the accompanying file COPYING.
11 ;;;; $Id: utilities.lisp,v 1.3 2004/02/10 00:04:24 ffjeld Exp $
13 ;;;;------------------------------------------------------------------
15 ;; FIXME: There is probably a better place in the great scheme of
16 ;; things for stuff like this...
19 ;; Unfortunately ANSI doesn't specify the slots and initargs of
20 ;; STYLE-WARNINGS... but we don't want to signal full WARNIGN either,
21 (define-condition style-note
(style-warning)
22 ((format :reader style-note-format
:initarg
:format
)
23 (args :reader style-note-args
:initarg
:args
))
24 (:report
(lambda (condition stream
)
27 (style-note-format condition
)
28 (style-note-args condition
)))))
30 (defun style-note (format &rest args
)
31 (signal 'style-note
:format format
:args args
))
33 ;; This is def-... for now, since that's the style followed elsewhere
35 (defmacro def-equal-constant
(name expr
&optional doc
)
36 "ANSI allows only EQL constants. Most lisps swallow EQUAL constants
37 as well, but not all. Hence this portability device."
38 #+acl
`(defconstant ,name
,expr
,doc
)
39 #+sbcl
`(sb-impl::defconstant-eqx
,name
,expr
#'equal
,doc
)
42 (style-note "DEF-EQUAL-CONSTANT not defined for this implementation. ~
43 Using DEFPARAMETER instead.")
44 (defparameter ,name
,expr
,doc
)))