[plt-scheme] rename-in syntax difficulties (and bug)

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Sat Jan 10 14:22:09 EST 2009

The following worked for me (in DrScheme 4.1.3):

#lang scheme
(require (lib "13.ss" "srfi"))   ; Strings
(require (rename-in (lib "69.ss" "srfi") [string-hash
basic-string-hash]))   ; Basic hash tables

Since you didn't post the code you tried with rename-in, I don't know
what went wrong.

You could also use prefix-in to give imports from either or both
libraries a prefix (so you'd have string:string-hash and
hash:string-hash, for instance), or except-in to simply exclude one of
the redundant bindings.


On Sat, Jan 10, 2009 at 2:09 PM, LordGeoffrey
<lordgeoffrey at optushome.com.au> wrote:
> I am trying to do the following:
> #lang scheme
> (require (lib "13.ss" "srfi"))   ; Strings
> (require (lib "69.ss" "srfi"))   ; Basic hash tables
> The produces the error:
> module: identifier already imported from a different source in:
>  string-hash
>  (lib "69.ss" "srfi")
>  (lib "13.ss" "srfi")
> Which makes sense. Though i am surprised it actually is a different source.
> I tried to used rename-in - but was unable to produce a syntax that was
> valid. Any suggestions on how to do the rename are appreciated, or possibly
> a better way to import so the clash doesn't happen at all.
> Thanks.

Posted on the users mailing list.