🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ti.explorer
Article #146

CLOS subtlety

#146
From: Clint Hyde 343-7709 Strong Typin...
Date: Tue, 28 Nov 1989 19:41
29 lines
1563 bytes
i've been using CLOS since early this year, with an interesting, but unsupportd
piece of code, which i've had to do maintenance on. it was actually written 
using PCL, and I ported it.

i find a number of cases like so:

(defmethod ((xxx some-class) ...)
  ...
  (setq xxx something-or-other)
  ...)

generally, some-class is LIST or T. 

this yields a CWARN stating that method was assigned to XXX (or another arg)
and that slot-accessors could not be correctly optimized.

it turns out that the problem is that XXX is getting modified in the body.
in partic, there are some destructive operations being performed on XXX, and I
need to preserve the result back in XXX, and this causes the compiler to
warn me. I don't know what the warning really implies--do I even care?

changing it so the the arg is xxx1 and then having the first form be (setq xxx
(copy xxx1)) at least eliminates the warning. there might be other solutions
which are better...this one works, but it bothers me. declaring the type of
xxx doesn't do it.

anyway, in case you ever see it, this is probably the cause.

 -- clint
Technical Details
Message-ID: <8911282032.AA25000@ti.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ngstl1.csc.ti.com!hyde

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ngstl1.csc.ti.com!hyde
From: hyde@ngstl1.csc.ti.com (Clint Hyde 343-7709 Strong Typing is for people with Weak Memories!)
Newsgroups: comp.sys.ti.explorer
Subject: CLOS subtlety
Message-ID: <8911282032.AA25000@ti.com>
Date: 28 Nov 89 19:41:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: inet
Organization: The Internet
Lines: 29