🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #391

Defining SETF :AFTER methods in PCL

#391
From: Rodney Daughtrey
Date: Thu, 17 Jan 1991 16:18
38 lines
1185 bytes
Consider the following code:



(defclass foo ()
  ((bar :type string
        :accessor foo-bar)))


(defmethod (setf foo-bar) :after ((self foo) value)
  (format t "~%FOO-BAR is now ~A" value))


(let ((foo-1 (make-instance 'foo)))
  (setf (foo-bar foo-1) "Hello"))



When I evaluate this code, I expected to see

FOO-BAR is now HELLO
"Hello"

but all I got was

"Hello"


What am I doing wrong?  Is there a better way to accomplish this?
I'm using PCL on the Macintosh using Allegro Common LISP 1.3.2.
Thanks!



Rodney Daughtrey           E-mail: rodney@huntsai.boeing.com
Huntsville AI Center               {major site}!uw-beaver!bcsaic!huntsai!rodney
Boeing Computer Services   Voice:  (205)-461-2352  Fax: (205)-461-2933
Technical Details
Message-ID: <9101171618.AA23624@huntsai.boeing.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!huntsai.boeing.com!rodney

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!huntsai.boeing.com!rodney
From: rodney@huntsai.boeing.com (Rodney Daughtrey)
Newsgroups: comp.lang.clos
Subject: Defining SETF :AFTER methods in PCL
Message-ID: <9101171618.AA23624@huntsai.boeing.com>
Date: 17 Jan 91 16:18:35 GMT
Sender: welch@tut.cis.ohio-state.edu
Distribution: inet
Organization: CommonLoops
Lines: 38