Newsgroups: comp.lang.lisp.mcl
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!tango.cs.uchicago.edu!mcdougal
From: Tom McDougal <mcdougal@cs.uchicago.edu>
Subject: Re: with-slots bug?
X-Nntp-Posting-Host: tango.cs.uchicago.edu
Content-Type: text/plain; charset=ISO-8859-1
Message-ID: <DCBurz.H2t@midway.uchicago.edu>
X-Xxmessage-Id: <AC3BBAA9BE010B33@tango.cs.uchicago.edu>
X-Xxdate: Wed, 26 Jul 1995 15:26:01 GMT
Sender: news@midway.uchicago.edu (News Administrator)
Content-Transfer-Encoding: 8bit
Organization: Univ. of Chicago Computer Science
X-Newsreader: Nuntius 2.0.4_68K
References: <199507251748.LAA17446@somnet.sandia.gov>
Mime-Version: 1.0
Date: Wed, 26 Jul 1995 14:26:22 GMT
Lines: 28

In article <199507251748.LAA17446@somnet.sandia.gov> Shannon V Spires,
svspire@somnet.sandia.gov writes:
>Here's a weird one. The second form below (defmethod BAR...)
>won't eval in interpreted mode, but it works fine in
>compiled mode, in MCL 2.0.1. 

I wonder if the problem is with the double macro-expansion of
a COND within a SETF.  The following code, which separates the
two with a LET, gets around your problem.


(defmethod BAR ((myself FOO))
  "The presence of the cond screws things up when trying to interpret this
   definition. Compiles fine in compiled mode."
  (with-slots (slot1) myself
    (let ((slot1-val (cond (t nil))))
      (setf slot1 slot1-val)
      )
    ))

I hope this helps.

-- 
Tom McDougal    University of Chicago Artificial Intelligence
     <mailto:mcdougal@cs.uchicago.edu> 
     <http://cs-www.uchicago.edu/~mcdougal>
     fax: (312) 702-7108
     PP-RH
