Fwd: [plt-scheme] already imported identitfiers in "pretty-big"

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Wed Apr 12 15:01:36 EDT 2006


On Wed, 12 Apr 2006, Corey Sweeney wrote:

> (module xxx (lib "plt-pretty-big-text.ss" "lang")
>  (require (lib "list.ss" "srfi" "1")))
>
> still gives:
>
> module: identifier already imported (from a different source) in: third


Hi Corey,

We can go the other direction, to make a custom module language that has 
the stuff that pretty-big-text has, except for the list functions.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(module my-big-language mzscheme
   (require (lib "etc.ss")
 	   (lib "file.ss")
 	   (lib "class.ss")
 	   (lib "unit.ss")
 	   (lib "unitsig.ss")
 	   (lib "include.ss")
 	   (lib "defmacro.ss")
 	   (lib "pretty.ss")
 	   (lib "string.ss")
 	   (lib "thread.ss")
 	   (lib "math.ss")
 	   (lib "match.ss")
 	   (lib "shared.ss")
 	   (lib "posn.ss" "lang"))

   (provide (all-from mzscheme)
 	   (all-from (lib "etc.ss"))
 	   (all-from (lib "file.ss"))
 	   (all-from (lib "class.ss"))
 	   (all-from (lib "unit.ss"))
 	   (all-from (lib "unitsig.ss"))
 	   (all-from (lib "include.ss"))
 	   (all-from (lib "defmacro.ss"))
 	   (all-from (lib "pretty.ss"))
 	   (all-from (lib "string.ss"))
 	   (all-from (lib "thread.ss"))
 	   (all-from (lib "math.ss"))
 	   (all-from (lib "match.ss"))
 	   (all-from (lib "shared.ss"))
 	   (all-from (lib "posn.ss" "lang"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Once we have our own custom module language, we should be able to do:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(module xxx "my-big-language.ss"
   (require (lib "list.ss" "srfi" "1")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

and not see conflicts.  And we can go the extra step and put the srfi-1 
functions into my-big-language as well.  This does pretty much what you're 
planning earlier, except we avoid touching plt-pretty-big-text.ss.


(Aside: I feel really cheesy about doing a copy-and-paste here; is there a 
nicer way to do this?)


Best of wishes!


Posted on the users mailing list.