* Reported by Harald Hanche-Olsen.
;; and comparing it with the new one.
(style-warn "redefining ~S in DEFMACRO" name))
(setf (sb!xc:macro-function name) definition)
- #-sb-xc-host
- (when doc
- (setf (%fun-doc definition) doc))
,(when set-p
- `(setf (%fun-lambda-list definition) lambda-list
+ `(setf (%fun-doc definition) doc
+ (%fun-lambda-list definition) lambda-list
(%fun-name definition) debug-name))
name))))
(progn
;; FIXME: warn about incompatible lambda list with
;; respect to parent function?
(setf (sb!xc:compiler-macro-function name) definition)
- #-sb-xc-host
- (setf (%fun-doc definition) doc)
,(when set-p
- `(setf (%fun-lambda-list definition) lambda-list
+ `(setf (%fun-doc definition) doc
+ (%fun-lambda-list definition) lambda-list
(%fun-name definition) debug-name))
name))))
(progn
(variable
(typecase x
(symbol (values (info :variable :documentation x)))))
+ ;; FUNCTION is not used at the momemnt, just here for symmetry.
(function
(cond ((functionp x)
(%fun-doc x))
- ((legal-fun-name-p x)
- (%fun-doc (fdefinition x)))))
+ ((and (legal-fun-name-p x) (fboundp x))
+ (%fun-doc (or (and (symbolp x) (macro-function x))
+ (fdefinition x))))))
(structure
(typecase x
(symbol (cond
(defmethod documentation ((x list) (doc-type (eql 'function)))
(when (and (legal-fun-name-p x) (fboundp x))
- (documentation (fdefinition x) t)))
+ (fun-doc (fdefinition x))))
(defmethod documentation ((x list) (doc-type (eql 'compiler-macro)))
(awhen (compiler-macro-function x)
(documentation it t)))
(defmethod documentation ((x symbol) (doc-type (eql 'function)))
- (when (fboundp x)
- (documentation (symbol-function x) t)))
+ (when (and (legal-fun-name-p x) (fboundp x))
+ (fun-doc (or (macro-function x) (fdefinition x)))))
(defmethod documentation ((x symbol) (doc-type (eql 'compiler-macro)))
(awhen (compiler-macro-function x)
(assert (string= (setf (documentation 'docfoo 'function) "baz") "baz"))
(assert (string= (documentation 'docfoo 'function) "baz"))
(assert (string= (documentation #'docfoo t) "baz")))
+
+#+sb-doc
+(with-test (:name (documentation built-in-macro))
+ (assert (documentation 'trace 'function)))
+
+#+sb-doc
+(with-test (:name (documentation built-in-function))
+ (assert (documentation 'cons 'function)))
\f
;;;; success
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.29.29"
+"1.0.29.30"