Changeset 4350 for trunk/j/src/org/armedbear/lisp/defclass.lisp
- Timestamp:
- 10/13/03 18:43:41 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/defclass.lisp
r4349 r4350 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: defclass.lisp,v 1.2 2 2003-10-13 14:12:26piso Exp $4 ;;; $Id: defclass.lisp,v 1.23 2003-10-13 18:43:41 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 908 908 method)) 909 909 910 ;;; add-method911 912 ;;; N.B. This version first removes any existing method on the generic function913 ;;; with the same qualifiers and specializers. It's a pain to develop914 ;;; programs without this feature of full CLOS.915 916 910 (defun add-method (gf method) 917 (let ((old-method 918 (find-method gf (method-qualifiers method) 919 (method-specializers method) nil))) 920 (when old-method (remove-method gf old-method))) 911 ;; Remove existing method with same qualifiers and specializers (if any). 912 (let ((old-method (find-method gf (method-qualifiers method) 913 (method-specializers method) nil))) 914 (when old-method 915 (remove-method gf old-method))) 921 916 (setf (method-generic-function method) gf) 922 917 (push method (generic-function-methods gf)) … … 924 919 (pushnew method (class-direct-methods specializer))) 925 920 (finalize-generic-function gf) 926 method)921 gf) 927 922 928 923 (defun remove-method (gf method) … … 935 930 (remove method (class-direct-methods class)))) 936 931 (finalize-generic-function gf) 937 method) 938 939 (defun find-method (gf qualifiers specializers 940 &optional (errorp t)) 932 gf) 933 934 (defun find-method (gf qualifiers specializers &optional (errorp t)) 941 935 (let ((method 942 936 (find-if #'(lambda (method) … … 947 941 (generic-function-methods gf)))) 948 942 (if (and (null method) errorp) 949 (error " No such method for ~S." (generic-function-name gf))943 (error "no such method for ~S" (generic-function-name gf)) 950 944 method))) 951 945
Note: See TracChangeset
for help on using the changeset viewer.