using describe on a macro function results in nothing being returned
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
Fix macro description when called like this:
(describe (macro-function 'cffi:with-
Within SLIME, the apropos mode can't currently handle macros because there is no way to show only the details of the macro's function. SBCL seems to have 2 function associated with a symbol (i don't really understand the complete details, but.. ) the symbol-function is a closure that has a different call signature to the actual macro-function.
The attached patch add's the ability for form returned from %fun-name to be correctly handled by the documentation function to make describe work correctly for macros.
Macro-functions are already handled by describe-function and describe-object, but the documentation string was never being passed back for the macro-function type.
What i currently see is this
CL-USER> (describe (macro-function 'with-locked-
#<FUNCTION (MACRO-FUNCTION WITH-LOCKED-
[compiled function]
Lambda-list: ((HASH-TABLE) &BODY BODY)
Derived type: (FUNCTION (T T) (VALUES CONS &OPTIONAL))
Documentation:
T
Source file: SYS:SRC;
; No value
This patch results in this
CL-USER> (describe (macro-function 'with-locked-
#<FUNCTION (MACRO-FUNCTION WITH-LOCKED-
[compiled function]
Lambda-list: ((HASH-TABLE) &BODY BODY)
Derived type: (FUNCTION (T T) (VALUES CONS &OPTIONAL))
Documentation:
Limits concurrent accesses to HASH-TABLE for the duration of BODY.
If HASH-TABLE is synchronized, BODY will execute with exclusive
ownership of the table. If HASH-TABLE is not synchronized, BODY will
execute with other WITH-LOCKED-
of hash-table accesses not surrounded by WITH-LOCKED-
unspecified.
Source file: SYS:SRC;
; No value
To be clear the following does work, but for consistency in the apropos mode in SLIME it would be best if we could target the macro-function directly. This is the corresponding fix for slime https:/ /github. com/russell/ slime/commit/ 1590cd6cba8a087 1364f212eb29c50 b73f67d7ba
CL-USER> (describe 'with-locked- hash-table) WITH-LOCKED- HASH-TABLE
SB-EXT:
[symbol]
WITH-LOCKED- HASH-TABLE names a macro: HASH-TABLE bodies excluded -- exclusion HASH-TABLE is CODE;TARGET- EXTENSIONS. LISP
Lambda-list: ((HASH-TABLE) &BODY BODY)
Documentation:
Limits concurrent accesses to HASH-TABLE for the duration of BODY.
If HASH-TABLE is synchronized, BODY will execute with exclusive
ownership of the table. If HASH-TABLE is not synchronized, BODY will
execute with other WITH-LOCKED-
of hash-table accesses not surrounded by WITH-LOCKED-
unspecified.
Source file: SYS:SRC;
; No value