Hi Chad,<br><br>Yes, it is redundant. See : <a href="http://docs.racket-lang.org/guide/modules.html">http://docs.racket-lang.org/guide/modules.html</a><br><br>Laurent<br><br><div class="gmail_quote">On Wed, May 9, 2012 at 11:28 PM, Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@hashcollision.org" target="_blank">dyoo@hashcollision.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[forwarding to racket-users]<br>
<br>
<br>
---------- Forwarded message ----------<br>
From: Chad Albers <<a href="mailto:calbers@neomantic.com">calbers@neomantic.com</a>><br>
Date: Wed, May 9, 2012 at 2:22 PM<br>
Subject: Re: [racket] Rationale behind missing string-trim<br>
To: Danny Yoo <<a href="mailto:dyoo@hashcollision.org">dyoo@hashcollision.org</a>><br>
<br>
<br>
Happy to help you guys identify a bug. On a side note, that's not<br>
really relevant to this thread, I was wondering about your statement<br>
about #lang racket.<br>
<br>
I had assume that you just add #lang racket, if you're writing a<br>
racket script, sort of like the hash bang syntax of a shell script.<br>
Is that a correct assumption? Related, the code I'm writing is<br>
actually in a module I'm creating, and I've used this to source the<br>
racket language:<br>
<br>
(module rig racket<br>
<br>
(require racket/base<br>
(for-syntax racket/base<br>
racket/syntax))<br>
<br>
Should I have used #lang racket? is racket/base redundant, since I<br>
have it in the module definition? Thanks for your help, if you can<br>
answer these questions for me.<br>
<br>
Chad<br>
<br>
--<br>
Chad Albers<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Wed, May 9, 2012 at 1:45 PM, Danny Yoo <<a href="mailto:dyoo@hashcollision.org">dyoo@hashcollision.org</a>> wrote:<br>
><br>
> On Wed, May 9, 2012 at 1:23 PM, Chad Albers <<a href="mailto:calbers@neomantic.com">calbers@neomantic.com</a>> wrote:<br>
> > If my require reads as follows<br>
> ><br>
> > (require racket/base<br>
> > srfi/13<br>
> > (for-syntax racket/base<br>
> > racket/syntax))<br>
> ><br>
> > I get the following error message:<br>
> ><br>
> > module: identifier already imported from: racket at: string-upcase in:<br>
> > srfi/13<br>
> ><br>
><br>
><br>
> Huh! That looks like the error reporting is misattributing the source<br>
> of the conflict. I'll send a bug report.<br>
><br>
> The error is highlighting the "racket" in the #lang line and srfi/13,<br>
> but the true source of the conflict's really between the exports of<br>
> racket/base and srfi/13. For demonstration, try:<br>
><br>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
> #lang racket<br>
> (require (only-in racket/base string-upcase)<br>
> srfi/13)<br>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
><br>
> vs:<br>
><br>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
> #lang racket<br>
> (require (only-in racket/base)<br>
> srfi/13)<br>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
><br>
> In the first, we tell Racket o use both the string-upcase function in<br>
> racket/base, as well as all the exports of srfi/13. Since both<br>
> requires provide a string-upcase function, there's a conflict, which<br>
> the DrRacket environment reports.<br>
><br>
> In the second, we mask out all the exports from racket/base. So the<br>
> exports of srfi/13 can otherwise shadow everything else without<br>
> complaint.<br>
><br>
><br>
><br>
> Side note: the big language of "#lang racket" provides everything in<br>
> racket/base, so the (require racket/base) is actually redundant. You<br>
> can write:<br>
><br>
> #lang racket<br>
> (require srfi/13)<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br>