And if you ever wondered why CLOS makes you spell<div>out the names of readers and accessors, this is why.</div><div>CLOS does not want to make any assumptions about</div><div>how you want to make decisions about what</div>
<div>packages things are in.</div><div><br></div><div>It's the "right thing" rather than the "worse is better"</div><div>way, with all the usual issues. In our own code,</div><div>we have a "define-class" macro that defines</div>
<div>all accessors automatically, interning them in</div><div>the package that makes sense for us. It's kind</div><div>of a middle path between defstruct and defclass.</div><div>I don't love it but I don't hate it...</div>
<div><br></div><div>-- Dan</div><div><br><div class="gmail_quote">On Sun, Jul 3, 2011 at 7:11 AM, Pascal J. Bourguignon <span dir="ltr"><<a href="mailto:pjb@informatimago.com">pjb@informatimago.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Kazimir Majorinc <<a href="mailto:kazimir@chem.pmf.hr">kazimir@chem.pmf.hr</a>><br>
writes:<br>
<br>
> I need comprehensive review of use of generated symbols (make-symbol,<br>
> copy-symbol, gensym... ) in CL. The books I have (both Grahams,<br>
> Siebel, barely mention these operators, except for use of gensym in<br>
> macros.<br>
><br>
> What are other typical or interesting uses of these?<br>
<br>
The most typical use, is a defstruct like macro, which derivates<br>
"public" names from a base name.<br>
<br>
<br>
(DEFSTRUCT COLOR RED GREEN BLUE)<br>
<br>
generates function definitions for:<br>
<br>
MAKE-COLOR COLOR-P COPY-COLOR COLOR-RED COLOR-GREEN COLOR-BLUE<br>
<br>
<br>
Ask yourself, what should:<br>
<br>
(DEFSTRUCT other-package:|color| |Red| other-package:|GREEN| |blue|)<br>
<br>
generate?<br>
<br>
(And the effect *print-case* should or should not have on that...)<br>
<br>
<br>
--<br>
__Pascal Bourguignon__ <a href="http://www.informatimago.com/" target="_blank">http://www.informatimago.com/</a><br>
A bad day in () is better than a good day in {}.<br>
<br>
<br>
_______________________________________________<br>
pro mailing list<br>
<a href="mailto:pro@common-lisp.net">pro@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro</a><br>
</blockquote></div><br></div>