;;;; This software is part of the SBCL system. See the README file for ;;;; more information. ;;;; ;;;; This software is derived from the CMU CL system, which was ;;;; written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. (in-package "SB!VM") (defmacro defenum ((&key (prefix "") (suffix "") (start 0) (step 1)) &rest identifiers) (let ((results nil) (index 0) (start (eval start)) (step (eval step))) (dolist (id identifiers) (when id (multiple-value-bind (root docs) (if (consp id) (values (car id) (cdr id)) (values id nil)) (push `(defconstant ,(intern (concatenate 'simple-string (string prefix) (string root) (string suffix))) ,(+ start (* step index)) ,@docs) results))) (incf index)) `(eval-when (:compile-toplevel :load-toplevel :execute) ,@(nreverse results))))