From: ············@gmail.com
Subject: export all symbols?
Date: 
Message-ID: <1104866951.433444.80260@c13g2000cwb.googlegroups.com>
Hi,

a package defines structures for the rest of the system, and a few
basic functions to operate on them. I want it to export all symbols
defined in it. Is

(defmacro EXPORT-SYMBOLS ()
"export all symbols defined in the current package"    '(do-symbols
(sym)
(when (eq (symbol-package sym) *package*)
(export sym)))) 


the right way to do that?

David

From: sds
Subject: Re: export all symbols?
Date: 
Message-ID: <1104871795.771574.88640@f14g2000cwb.googlegroups.com>
············@gmail.com wrote:
> a package defines structures for the rest of the system, and a few
> basic functions to operate on them. I want it to export all symbols
> defined in it.

you want to use
<http://clocc.sourceforge.net/clocc/src/ext/exporting/exporting.lisp>
From: ············@gmail.com
Subject: Re: export all symbols?
Date: 
Message-ID: <1104906049.680595.138780@z14g2000cwz.googlegroups.com>
This is almost what I need. From reading the source I think that it
does not handle (:include ) in defstruct. Is it the case?
From: sds
Subject: Re: export all symbols?
Date: 
Message-ID: <1104937703.785110.262850@z14g2000cwz.googlegroups.com>
yes, for now.
the version of exporting.lisp that will come with the next CLISP
release already does
and the CLOCC version will support that soon too.
From: Pascal Costanza
Subject: Re: export all symbols?
Date: 
Message-ID: <cret0b$162$1@newsreader2.netcologne.de>
············@gmail.com wrote:
> Hi,
> 
> a package defines structures for the rest of the system, and a few
> basic functions to operate on them. I want it to export all symbols
> defined in it. Is
> 
> (defmacro EXPORT-SYMBOLS ()
> "export all symbols defined in the current package"    '(do-symbols
> (sym)
> (when (eq (symbol-package sym) *package*)
> (export sym)))) 
> 
> the right way to do that?

Probably not, especially because what you say is also probably not what 
you want. Under the assumption that the above code is executed in the 
said package, for example SYM will also be exported because it's also a 
symbol interned in that package. (I am talking about the local variable 
used in your macro.)

It's better to be explicit about what you export, even if it seems 
tedious at first. If you want something more implicit, you could 
consider defining some macros like, say, DEFINE-EXPORTED-FUNCTION that 
expands into a DEFUN and a respective EXPORT.


Pascal

-- 
The big bang way only works for god, everybody else has to use 
evolution. - David Moon