Added dwim-accessor-name-transformer which defaults to <slot-name>? for boolean slots.
Wed Jun 3 08:06:58 PDT 2009 levente.meszaros@gmail.com
* Added dwim-accessor-name-transformer which defaults to <slot-name>? for boolean slots.
Warning: CRC errors found. These are probably harmless but should be repaired.
See 'darcs gzcrcs --help' for more information.
diff -rN -u old-defclass-star/defclass-star.lisp new-defclass-star/defclass-star.lisp
--- old-defclass-star/defclass-star.lisp 2014-07-28 21:38:05.000000000 -0700
+++ new-defclass-star/defclass-star.lisp 2014-07-28 21:38:05.000000000 -0700
@@ -57,14 +57,17 @@
(defun style-warn (datum &rest args)
(warn 'defclass-star-style-warning :format-control datum :format-arguments args))
+(defun slot-name-package (name)
+ (if (packagep *accessor-name-package*)
+ *accessor-name-package*
+ (case *accessor-name-package*
+ (:slot-name (symbol-package name))
+ (:default *package*)
+ (t *package*))))
+
(defun default-accessor-name-transformer (name definition)
(let ((type (getf definition :type))
- (package (if (packagep *accessor-name-package*)
- *accessor-name-package*
- (case *accessor-name-package*
- (:slot-name (symbol-package name))
- (:default *package*)
- (t *package*)))))
+ (package (slot-name-package name)))
(if (eq type 'boolean)
(let* ((name-string (string name))
(last-char (aref name-string (1- (length name-string)))))
@@ -79,6 +82,16 @@
(t (concatenate-symbol name "-P" package))))
(concatenate-symbol name "-OF" package))))
+(defun dwim-accessor-name-transformer (name definition)
+ (let ((type (getf definition :type))
+ (package (slot-name-package name)))
+ (if (eq type 'boolean)
+ (let* ((name-string (string name)))
+ (if (char= #\? (elt name-string (1- (length name-string))))
+ name
+ (concatenate-symbol name "?" package)))
+ (concatenate-symbol name "-OF" package))))
+
(defun default-initarg-name-transformer (name definition)
(declare (ignorable definition))
(concatenate-symbol name #.(symbol-package :asdf)))
diff -rN -u old-defclass-star/package.lisp new-defclass-star/package.lisp
--- old-defclass-star/package.lisp 2014-07-28 21:38:05.000000000 -0700
+++ new-defclass-star/package.lisp 2014-07-28 21:38:05.000000000 -0700
@@ -14,6 +14,7 @@
#:defcondition*
#:default-accessor-name-transformer
+ #:dwim-accessor-name-transformer
#:default-initarg-name-transformer
#:default-slot-definition-transformer
#:make-name-transformer