[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new version of PCL
- To: commonloops.pa@Xerox.COM
- Subject: Re: new version of PCL
- From: Rob Pettengill <rcp@sw.MCC.COM>
- Date: Thu, 8 Dec 88 09:19:55 CST
- Redistributed: commonloops.pa
First the good news. The new PCL does compile, load, and run the test
file in Franz Allegro 3.0.1 (with patches 1, 3, 12, 21.2, 22).
A minor nit: the notes.text file refers to this as the 12/27/88
version rather than the 12/7/88 version.
A major bug in effective method computation which was present in the
last version, 8/28/88, is still present in the new 12/7/88 version. I
am enclosing my bug report with a workaround for that version. I have
not yet checked to see if the workaround given below is still valid.
;rob
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Date: Wed, 7 Sep 88 14:54:59 CDT
From: Rob Pettengill <rcp>
To: Gregor.pa@Xerox.com
Subject: Bug in effective method computation (compute-combination-points)
Cc: CommonLoops.pa@Xerox.COM, halasz
;;; -*- Mode:Lisp; Package: pclt; Syntax:COMMON-LISP; Base:10 -*-
#|
; (LISP-IMPLEMENTATION-TYPE) = Allegro CL
; (LISP-IMPLEMENTATION-VERSION) = 3.0.1 [sun3] (8/16/88 17:44)
; (SOFTWARE-TYPE) = SMI Unix
; (MACHINE-TYPE) = Sun Microsystems
; PCL::*PCL-SYSTEM-DATE* = 8/28/88 (beta rev 1) AAAI PCL
This file illustrates a bug in the computation of combined methods which
results in the the effective method missing certain inherited methods.
A simple class hierarchy with a single method foo that illustrates this bug
is shown below.
A-WITH-FOO
/ \
/ \
/ \
/ \
B-WITH-FOO C-WITH-FOO
| / |
| / |
| / |
D-WITH-FOO E-WITHOUT-FOO
\ /
\ /
\ /
\ /
\ /
\ /
F-WITH-BAZ-THAT-CALLS-FOO
The expected outcome of a call to BAZ on an instance of
F-WITH-BAZ-THAT-CALLS-FOO should be
<cl> (pclt::run-test)
Hello from BAZ in F
Hello from FOO in D-WITH-FOO
Hello from FOO in B-WITH-FOO
Hello from FOO in C-WITH-FOO
Hello from FOO in A-WITH-FOO
NIL
however the actual outcome is
<cl> (pclt::run-test)
Hello from BAZ in F
Hello from FOO in B-WITH-FOO
Hello from FOO in C-WITH-FOO
Hello from FOO in A-WITH-FOO
NIL
We have found a kludge that fixes this particular case by the following
change to combin.lisp
(defun compute-combination-points (generic-function)
(let* ((gf-methods (generic-function-methods generic-function))
(result ()))
(dolist (m (append gf-methods gf-methods))
______________________________ changed from gf-methods
so that the list of methods is traversed twice ...
|#
(IN-PACKAGE 'PCLT :USE '(PCL LISP))
(defclass A-WITH-FOO
()
()
)
(defmethod FOO ((SELF A-WITH-FOO))
(format t "~%Hello from FOO in A-WITH-FOO")
)
(defclass B-WITH-FOO
(A-WITH-FOO)
()
)
(defmethod FOO ((SELF B-WITH-FOO))
(format t "~%Hello from FOO in B-WITH-FOO")
(call-next-method))
(defclass C-WITH-FOO
(A-WITH-FOO)
( )
)
(defmethod FOO
((SELF C-WITH-FOO))
(format t "~%Hello from FOO in C-WITH-FOO")
(call-next-method)
)
(defclass D-WITH-FOO
(B-WITH-FOO C-WITH-FOO) ;was bordered- ...
()
)
(defmethod FOO
((SELF D-WITH-FOO))
(format t "~%Hello from FOO in D-WITH-FOO")
(call-next-method)
)
(defclass E-WITHOUT-FOO
(C-WITH-FOO)
()
)
(defclass F-WITH-BAZ-THAT-CALLS-FOO
(D-WITH-FOO E-WITHOUT-FOO)
()
)
(defmethod BAZ
((SELF F-WITH-BAZ-THAT-CALLS-FOO))
(format t "~%Hello from BAZ in F")
(FOO SELF))
(defun run-test ()
(let ((x (make-instance 'F-WITH-BAZ-THAT-CALLS-FOO)))
(baz x)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Robert C. Pettengill, MCC Software Technology Program
P. O. Box 200195, Austin, Texas 78720
ARPA: rcp@mcc.com PHONE: (512) 338-3533
UUCP: {ihnp4,seismo,harvard,gatech,pyramid}!ut-sally!im4u!milano!rcp