Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!rutgers!aramis.rutgers.edu!atanasoff.rutgers.edu!lou From: lou@atanasoff.rutgers.edu (Lou Steinberg) Newsgroups: comp.lang.lisp Subject: Re: updating random slots in (say) defstruct Message-ID: Date: 15 Jan 90 17:33:52 GMT References: <18963@bellcore.bellcore.com> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 30 To: pc@flash.bellcore.com In article <18963@bellcore.bellcore.com> pc@flash.bellcore.com writes: > > In article <18837@bellcore.bellcore.com> pc@flash.bellcore.com writes: > > > In ANSI Common Lisp you'll be able to use #'(setf test-one) to access the > > updater function directly. > > Ah, now this is closer to what i was looking for. But what i want to > do, is define a SETFable function created with (INTERN (string-append > "-" )). Perhaps i really have to throw the > whole expression i've consed up to EVAL. But that really is a bit > gross. Well, you could set up your own hash table or other data structure to convert the symbols returned by INTERN into the functions (using e.g. #'(setf test-one) to find out what they are). Better yet, you could use some such data structure to directly map the pairs (defstruct-name slot-name) into setf functions. Or, some simple poking around might well tell you how to access the SETF functions already there in your implementation. E.g. I think in Allegro if you look at the property list of a symbol with a setf-able function it is pretty clear how to find the setf function. Of course, this will not be portable, and may even break with a new release of your lisp. -- Lou Steinberg uucp: {pretty much any major site}!rutgers!aramis.rutgers.edu!lou arpa: lou@cs.rutgers.edu