Changeset 4351


Ignore:
Timestamp:
10/13/03 19:21:27 (19 years ago)
Author:
piso
Message:

CHECK-CONGRUENT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/defclass.lisp

    r4350 r4351  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: defclass.lisp,v 1.23 2003-10-13 18:43:41 piso Exp $
     4;;; $Id: defclass.lisp,v 1.24 2003-10-13 19:21:27 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    794794
    795795(defun gf-required-arglist (gf)
    796   (let ((plist
    797          (analyze-lambda-list
    798           (generic-function-lambda-list gf))))
     796  (let ((plist (analyze-lambda-list (generic-function-lambda-list gf))))
    799797    (getf plist ':required-args)))
    800798
     
    908906    method))
    909907
     908(defun check-congruent (gf method)
     909  (let* ((plist1 (analyze-lambda-list (generic-function-lambda-list gf)))
     910         (args1 (getf plist1 :required-args))
     911         (plist2 (analyze-lambda-list (method-lambda-list method)))
     912         (args2 (getf plist2 :required-args)))
     913    (unless (= (length args1) (length args2))
     914      (error "lambda lists are not congruent"))))
     915
    910916(defun add-method (gf method)
     917  (check-congruent gf method)
    911918  ;; Remove existing method with same qualifiers and specializers (if any).
    912919  (let ((old-method (find-method gf (method-qualifiers method)
Note: See TracChangeset for help on using the changeset viewer.