[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'class-named' in PCL 5-22-rev3 on HP Common Lisp



In PCL 5-22-rev3 on HP Common Lisp:

The CLOS document on pg. 2-13 indicates that if <errorp> is
NIL, 'class-named' will not signal an error if a class corresponding
to the symbol supplied is not found. If <errorp> is unsupplied or
non-NIL, an error will be signalled.

        class-named  <name>  &optional <errorp>      [Function]

The implementation exhibits the opposite behavior: An error is
signalled if <errorp> is NIL, and <errorp> defaults to NIL.

An easy fix is to make the following changes to function 'class-named'
in the file 'macros.lisp':

; In file macros.lisp:

;(defun class-named (name &optional no-error-p)    ; Remove this line
(defun class-named (name &optional (error-p T))    ; Add this line
  (or (gethash name *class-name-hash-table*)
;;;;;;(cond (no-error-p nil)                       ; Remove this line
      (cond ((null error-p) nil)                   ; Add this line
	    ((legal-class-name-p name)
	     (error "No class named: ~S." name))
	    (t
	     (error "~S is not a legal class name." name)))))
;;; end


Roy D'Souza    dsouza@hplabs.hp.com   (415) 857-7557