Print empty/NIL defgeneric/defmethod arglists prettily
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
SBCL is good at printing quoted Lisp forms, and I sometimes use it as a code formatter. It's especially good with DEFUN forms*
(print '(defun foo ()
(+ 1 2 3)
(+ result 88))))
(DEFUN FOO ()
(MULTIPLE-
(+ 1 2 3)
(+ RESULT 88)))
But it doesn't work with defmethod/
(print '(defmethod foo ()
(+ 1 2 3)
(+ result 88))))
(DEFMETHOD FOO NIL
(+ RESULT 88)))
(print '(defclass foo ()
((a :initform 4)
(b :accessor b
(DEFCLASS FOO NIL
((A :INITFORM 4)
(B :ACCESSOR B :INITARG :B)))
The same thing:
- empty argument/superclass list is printed as NIL.
- The body is off, as if it's a generic list printing.
Would be nice to have arglist/
(DEFMETHOD FOO ()
(MULTIPLE-
(RESULT) (+ 1 2 3)
(+ RESULT 88)))
(DEFCLASS FOO ()
((A :INITFORM 4)
(B :ACCESSOR B :INITARG :B)))
I understand that this is likely quite an atypical use-case, so not urging or requiring any action. Feel free to close if it's a non-goal.
All the forms are printed with
- *print-
- on SBCL 2.3.5
- on machine uname Linux paranoidal 6.4.16 #1 SMP PREEMPT_DYNAMIC 1 x86_64 GNU/Linux
- with *features*
(CFFI-FEATURES:
CFFI-FEATURES:
CFFI-FEATURES:UNIX :CFFI
CFFI-SYS:
ALEXANDRIA:
:ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3
:ASDF2 :ASDF :OS-UNIX
:NON-BASE-
:ARENA-ALLOCATOR :X86-64 :GENCGC
:64-BIT :ANSI-CL :COMMON-LISP :ELF
:IEEE-
:LITTLE-ENDIAN
:PACKAGE-
:SB-CORE-
:SB-PACKAGE-LOCKS :SB-THREAD
:SB-UNICODE :SBCL :UNIX)