From: Kai-Peter B{ckman
Subject: Problems with SETF.
Date: 
Message-ID: <1994Apr26.161546.7989@krk.fi>
 I am relatively new with lisp and I have encountered the following problem
that I am unable to solve on my own:

> (defun myfun (par) (car par))
> (setq a '(f o o))
> (setf (car a) 1)
> a
(1 O O)
> (setf (myfun a) 2)
ERROR: Unknown function (SETF MYFUN)

 The interpreter does the same for all functions except for the primary ones
ie. CAR, CDR, CONS, ATOM and EQ.

 Thanks in advance for all help.

 Kai-Peter Baeckman
 ······@krksun.krk.fi
 
From: Barry Margolin
Subject: Re: Problems with SETF.
Date: 
Message-ID: <2ppb5bINN2o1@early-bird.think.com>
In article <·····················@krk.fi> ······@krksun.krk.fi (Kai-Peter B{ckman) writes:
>> (defun myfun (par) (car par))
>> (setq a '(f o o))
>> (setf (car a) 1)
>> a
>(1 O O)
>> (setf (myfun a) 2)
>ERROR: Unknown function (SETF MYFUN)

Initially, SETF only knows how to handle certain built-in functions and
macros that expand into a call to a function it knows about.  If you want
to be able to supply user-defined functions, you must teach it how to
handle those functions by using define-setf-method, defsetf, or defining a
function named (SETF MYFUN).  This is all described in CLtL2.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar