From: Barry Margolin
Subject: Re: exporting/importing a (defsetf foobar #)
Date: 
Message-ID: <1r1nklINN3n1@early-bird.think.com>
In article <·······················@eratu.rz.uni-konstanz.de> ······@inf-wiss.ivp.uni-konstanz.de (Joerg-Cyril Hoehle) writes:
>(defun foobar #)
>(defsetf foobar #)
>
>How do I export/import the defsetf function name correctly? Do I have
>to (export 'foobar) even if I don't want the function foobar itself to
>be exported, only the (setf foobar)?

Yes.  Packages contain symbols, not function bindings.  Either the symbol
FOOBAR is exported/imported, or it isn't.  You can't export a list.

However, note that there's no built-in requirement that a setf function
actually correspond to an existing reader function.  You could do:

(export 'foobar)

(defun foobar-internal ...)
(defsetf foobar-internal ...)

(defun foobar (...) (error ...))
(defsetf foobar ...) ; this just calls (setf foobar-internal)

This has the unfortunate property that code in the package must refer to
FOOBAR-INTERNAL rather than FOOBAR.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

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