<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 7 Oct 2006, at 11:42, Attila Lendvai wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR>Pascal, here's another good use of contextl:<BR><BR><A href="http://common-lisp.net/pipermail/metacopy-devel/2006-October/thread.html#0">http://common-lisp.net/pipermail/metacopy-devel/2006-October/thread.html#0</A><BR> <BR>only 3 mails, but in summary: there's a generic copy-thing protocol which is a one-fits-all copy protocol. but one could easily build some macrology on top of it for customized copy protocols that are the extension/customizations of the generic copy-thing protocol and/or other copy protocols. <BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hm, of course I like it when people find uses for ContextL. However, wouldn't a separation into different copy functions be sufficient here? (So, having separate functions like deep-copy, shallow-copy, structure-copy, and so on?)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Note: I don't enough about metacopy, so it's very likely that I am missing something here.</DIV><BR><BLOCKQUOTE type="cite">besides the usefulness i think this could be a very good demonstration of contextl. we need this, so i'll either work on metacopy to integrate with contextl (not likely, unless i find a way to integrate metacopy and contextl so that the contextl dependency is optional) or create a standalone metacopy-like package that depends on contextl. <BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Making ContextL optional is not straightforward because ContextL requires generic functions to be of the right metaclass, i.e., layered-function. In principle, CLOS specifices that you can change the metaclass of a generic function via change-class, but I am aware of only one CL implementation that actually implements this (that would be clisp), and I have doubts that this is a good idea in the first place.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>One idea would be to have a common entry point, roughly like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(defun copy (&rest args)</DIV><DIV>  (declare (dynamic-extent args))</DIV><DIV>  #+layered-copy (apply #'layered-copy args)</DIV><DIV>  #-layered-copy (apply #'generic-copy args))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>With the right optimization settings, this shouldn't be too costly.</DIV></DIV><DIV><BR><BLOCKQUOTE type="cite">hoping you find this interesting,<BR clear="all"></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Yep. ;)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Pascal</DIV></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Pascal Costanza, <A href="mailto:pc@p-cos.net">mailto:pc@p-cos.net</A>, <A href="http://p-cos.net">http://p-cos.net</A></DIV><DIV>Vrije Universiteit Brussel, Programming Technology Lab</DIV><DIV>Pleinlaan 2, B-1050 Brussel, Belgium</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>