On Tue, Jan 29, 2013 at 6:39 PM, Peter Enerccio <enerc...@gmail.com> wrote:

> Well I tried the shadowing import, compiles fine, but when attempting to
> load that fas, it will throw redefinition error
>

Sorry for answering so late, but I just started to scan for unread emails.

The problem with your code is that SHADOWING-IMPORT is importing the
CL:OPEN symbol into your package Thus you are redefining CL:OPEN.

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.

(defpackage my-io
  (:shadow :open))

(defun open (...)
   ...)

(defpackage other-package
  (:use :cl :my-io)
  (:shadowing-import-from :my-io :open))

A probably simpler way to achieve the same would be to do a replacement
package for CL. You would do

(defpackage :my-cl
 (:use :cl)
 (:shadow :open)
 (:export :open))

(let ((p (find-package "MY-CL")))
 (do-external-symbols (s (find-package "CL"))
  (unless (string-equal "OPEN" s)
   (export s p))))


(defpackage :my-other
  (:use :my-cl))

(print (symbol-package (find-symbol "OPEN" (find-package "MY-OTHER"))))
=> prints MY-OTHER
(print (symbol-package (find-symbol "COS" (find-package "MY-OTHER"))))
=> prints COMMON-LISP

-- 
Instituto de FĂ­sica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to