🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #2

passing accessors to functions

#2
From: Jeffrey B Kane
Date: Wed, 28 Oct 1992 20:49
13 lines
740 bytes
I have an question:

I have a common function that can act on any of a number of 
slots of a given class.  How can I define a function such that
I can pass it an accessor, the class instance, and the arguments
something like:


(defun do-proc (anAccessor aclass arg)
  (setf (anAccessor aclass) arg))

     Jeffrey
Technical Details
Message-ID: <Bwun61.E1q@world.std.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!sol.ctr.columbia.edu!eff!world!jbk

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!sol.ctr.columbia.edu!eff!world!jbk
From: jbk@world.std.com (Jeffrey B Kane)
Subject: passing accessors to functions
Message-ID: <Bwun61.E1q@world.std.com>
Summary: How to pass arbitrary accessors to functions
Keywords: ACCESSORS FUNCTIONS
Organization: The World Public Access UNIX, Brookline, MA
Date: Wed, 28 Oct 1992 20:49:12 GMT
Lines: 15