Ticket #468 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

find-applicable-methods errors when called with class-instances instead of symbols

Reported by: rs Owned by:
Priority: normal Milestone:
Component: other Version: 1.3
Keywords: xref slime WHO-CALLS Cc:

Description

find-applicable-methods expects to be called with symbols:

(ccl::FIND-APPLICABLE-METHODS 'PROCESS-KILL '(PROCESS) nil) -> (#<CCL::STANDARD-KERNEL-METHOD PROCESS-KILL (PROCESS)>)

but "some" functions pass a list of actual classes as the args parameter, like swank-backend::xref-locations so i can't use "who calls".

my workaround is to map the args list and replace non-symbols by the class-name like this:

(defun find-applicable-methods (name args qualifiers)
  (setf args
	(mapcar #'(lambda (arg)
		    (if (symbolp arg)
			arg
			(class-name arg)))
		args))
  ...)

you can trigger the error without slime with xref-describe:

Welcome to Clozure Common Lisp Version 1.3-r11936  (DarwinX8664)!
? (ccl::xref-describe 'ccl:process-interrupt :verbose t)

 PROCESS-INTERRUPT is directly called by:
     PROCESS-ABORT
       Type: FUNCTION
       File: /Users/Shared/develop/lisp/ccl/level-1/l1-processes.lisp

     PROCESS-KILL (#<STANDARD-CLASS PROCESS>)
       Type: METHOD
> Error: Class named #<STANDARD-CLASS PROCESS> not found.
...
1 > :B
 (6A57C8) : 0 (FIND-CLASS #<STANDARD-CLASS PROCESS> NIL NIL) 669
 (6A5828) : 1 (FIND-APPLICABLE-METHODS PROCESS-KILL (#<STANDARD-CLASS PROCESS>) NIL) 2093
 (6A58A8) : 2 (GET-SOURCE-FILES-WITH-TYPES (PROCESS-KILL (#<STANDARD-CLASS PROCESS>)) METHOD) 357
 (6A5918) : 3 (EDIT-DEFINITION-P (PROCESS-KILL (#<STANDARD-CLASS PROCESS>)) METHOD) 125
 (6A5960) : 4 (%SOURCE-FILE-FOR-XREF-ENTRY #<XREF-ENTRY PROCESS-KILL METHOD (#<STANDARD-CLASS PROCESS>)>) 205
 (6A5980) : 5 (%PRINT-XREF-ENTRIES (#<XREF-ENTRY PROCESS-ABORT FUNCTION> #<XREF-ENTRY PROCESS-KILL METHOD #> #<XREF-ENTRY PROCESS-RESET METHOD #> #<XREF-ENTRY QUIT FUNCTION> #<XREF-ENTRY INTERACTIVE-ABORT-IN-PROCESS FUNCTION> ...) #<ECHOING-TWO-WAY-STREAM input #<BASIC-CHARACTER-INPUT-STREAM ISO-8859-1 (TTY/0) #x300040F00FED>, output #<BASIC-CHARACTER-OUTPUT-STREAM ISO-8859-1 (TTY/1) #x300040F00ADD> #x300040F03A7D> T) 477
 (6A59B8) : 6 (WHO-DIRECTLY-CALLS PROCESS-INTERRUPT :INVERSE NIL :IN-FILES NIL :IN-FUNCTIONS NIL :VERBOSE T :STREAM #<ECHOING-TWO-WAY-STREAM input #<BASIC-CHARACTER-INPUT-STREAM ISO-8859-1 (TTY/0) #x300040F00FED>, output #<BASIC-CHARACTER-OUTPUT-STREAM ISO-8859-1 (TTY/1) #x300040F00ADD> #x300040F03A7D>) 397
 (6A5A28) : 7 (WHO-CALLS PROCESS-INTERRUPT :INVERSE NIL :IN-FILES NIL :IN-FUNCTIONS NIL :VERBOSE T :STREAM #<ECHOING-TWO-WAY-STREAM input #<BASIC-CHARACTER-INPUT-STREAM ISO-8859-1 (TTY/0) #x300040F00FED>, output #<BASIC-CHARACTER-OUTPUT-STREAM ISO-8859-1 (TTY/1) #x300040F00ADD> #x300040F03A7D>) 189
 (6A5A90) : 8 (XREF-DESCRIBE PROCESS-INTERRUPT :VERBOSE T) 189


Change History

comment:1 Changed 5 years ago by rme

  • Status changed from new to closed
  • Resolution set to fixed

should be fixed in the trunk as of r12335

Note: See TracTickets for help on using tickets.