File: cl-plus.lisp

package info (click to toggle)
cl-plus 1.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 36 kB
  • ctags: 8
  • sloc: makefile: 44; sh: 28; lisp: 10
file content (15 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;;; This package definition and exporting approach permits incremental
;;; additions to the CL+ package by a local user without compiler warnings
;;; (which can otherwise result in compilation being aborted).
(eval-when (:compile-toplevel :load-toplevel :execute)
  (ignore-errors (make-package '#:cl+ :use '(#:cl))))

(in-package #:cl+)

(export 'defconst)
(defmacro defconst (name initial-value &optional doc)
  "Only evaluates INITIAL-VALUE when NAME is unbound to a value."
  `(eval-when (:compile-toplevel :load-toplevel :execute)
    (if (boundp ',name)
	',name
	(defconstant ,name ,initial-value ,@(when doc (list doc))))))