Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(swank): improve doc-str to work with any objects, not only functions #471

Merged
merged 1 commit into from
Mar 26, 2023
Merged

Conversation

UnkwUsr
Copy link
Contributor

@UnkwUsr UnkwUsr commented Mar 8, 2023

Honestly, I'm not familiar with common lisp (only touching it lesser than a week), so will be good if someone with good common lisp knowledge approve it.


Original doc-str was constructing things like: (describe #'list)

Eval result
(describe #'list)
; #<FUNCTION LIST>
;   [compiled function]
; 
; 
; Lambda-list: (&REST ARGS)
; Declared type: (FUNCTION * (VALUES LIST &OPTIONAL))
; Derived type: (FUNCTION (&REST T) (VALUES LIST &OPTIONAL))
; Documentation:
;   Construct and return a list containing the objects ARGS.
; Known attributes: flushable, unsafely-flushable, movable
; Source file: SYS:SRC;CODE;LIST.LISP

and: (describe #'defun)

Eval result
(describe #'defun)
; COMMON-LISP:DEFUN is a macro, not a function.

When with this fix it does: (describe 'list)

Eval result
(describe 'list)
; COMMON-LISP:LIST
;   [symbol]
; 
; LIST names a compiled function:
;   Lambda-list: (&REST ARGS)
;   Declared type: (FUNCTION * (VALUES LIST &OPTIONAL))
;   Derived type: (FUNCTION (&REST T) (VALUES LIST &OPTIONAL))
;   Documentation:
;     Construct and return a list containing the objects ARGS.
;   Known attributes: flushable, unsafely-flushable, movable
;   Source file: SYS:SRC;CODE;LIST.LISP
; 
; LIST names the built-in-class #<BUILT-IN-CLASS COMMON-LISP:LIST>:
;   Class precedence-list: LIST, SEQUENCE, T
;   Direct superclasses: SEQUENCE
;   Direct subclasses: CONS, NULL
;   Sealed.
;   No direct slots.

and: (describe 'defun)

Eval result
(describe 'defun)
; COMMON-LISP:DEFUN
;   [symbol]
; 
; DEFUN names a macro:
;   Lambda-list: (NAME LAMBDA-LIST &BODY BODY)
;   Documentation:
;     Define a function at top level.
;   Source file: SYS:SRC;CODE;MACROS.LISP

So it works both for functions and macros (and whatever other?)

@Olical
Copy link
Owner

Olical commented Mar 26, 2023

I don't know enough about the language to dispute this one way or the other but I'll merge to develop for now and let people try it. Looks absolutely fine to me! I worry some symbols require the original code and some require the new one you added, but I guess we'll find out?

It makes sense to me that the single quote will handle everything, but as I'm no expert I can't be 100% sure.

@Olical Olical merged commit ac4f6cb into Olical:develop Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants