<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 29, 2013 at 6:39 PM, Peter Enerccio <span dir="ltr"><<a href="mailto:enerccio@gmail.com" target="_blank">enerccio@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Well I tried the shadowing import, compiles fine, but when attempting to load that fas, it will throw redefinition error<br>
</div></blockquote></div><br>Sorry for answering so late, but I just started to scan for unread emails.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The problem with your code is that SHADOWING-IMPORT is importing the CL:OPEN symbol into your package Thus you are redefining CL:OPEN.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">What you should instead do is define your I/O package and define a symbol OPEN in it and SHADOWING-IMPORT it from _other_ packages.</div><div class="gmail_extra">
<br></div><div class="gmail_extra" style>(defpackage my-io</div><div class="gmail_extra" style> (:shadow :open))</div><div class="gmail_extra"><br></div><div class="gmail_extra">(defun open (...)</div><div class="gmail_extra">
...)</div><div class="gmail_extra"><br></div><div class="gmail_extra">(defpackage other-package</div><div class="gmail_extra"> (:use :cl :my-io)</div><div class="gmail_extra"> (:shadowing-import-from :my-io :open))<br>
<br>A probably simpler way to achieve the same would be to do a replacement package for CL. You would do</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">(defpackage :my-cl</div><div class="gmail_extra">
(:use :cl)</div><div class="gmail_extra"> (:shadow :open)</div><div class="gmail_extra"> (:export :open))</div><div class="gmail_extra"><br></div><div class="gmail_extra">(let ((p (find-package "MY-CL")))</div>
<div class="gmail_extra"> (do-external-symbols (s (find-package "CL"))</div><div class="gmail_extra"> (unless (string-equal "OPEN" s)</div><div class="gmail_extra"> (export s p))))</div><div class="gmail_extra">
<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">(defpackage :my-other</div><div class="gmail_extra"> (:use :my-cl))</div><div class="gmail_extra"><br></div><div class="gmail_extra">(print (symbol-package (find-symbol "OPEN" (find-package "MY-OTHER"))))</div>
<div class="gmail_extra" style>=> prints MY-OTHER</div><div class="gmail_extra">(print (symbol-package (find-symbol "COS" (find-package "MY-OTHER"))))</div><div style>=> prints COMMON-LISP</div>
</div>
<div class="gmail_extra"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a>
</div></div>