Thanks. The last example is *very* useful :)<div><br clear="all">-- <br>Regards,<br> Imran Rafique<br>
<br><br><div class="gmail_quote">On 19 January 2012 14:57, Grant Rettke <span dir="ltr"><<a href="mailto:grettke@acm.org">grettke@acm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My cheatsheet:<br>
<br>
<a href="http://www.wisdomandwonder.com/link/2028/how-pltcollects-works-in-plt-scheme" target="_blank">http://www.wisdomandwonder.com/link/2028/how-pltcollects-works-in-plt-scheme</a><br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Jan 19, 2012 at 4:50 PM, Imran Rafique <<a href="mailto:imran@rafique.org">imran@rafique.org</a>> wrote:<br>
> Responding to the 2nd part (raco -link)<br>
><br>
> Both $PLTCOLLECTS & `raco -link` persist across different racket<br>
> installations (ie: they're independent of how and when you compiled &<br>
> installed racket itself), but it seems that collections directories added by<br>
> `raco -link` take precedence over $PLTCOLLECTS.<br>
><br>
> Eg:<br>
> # contents = /foo/imran/prelude.rkt<br>
> export PLTCOLLECTS="/foo:"<br>
><br>
> # contents = /foo2/prelude.rkt<br>
> raco -link -n imran /foo2<br>
><br>
> Then, (require imran/prelude) *NEVER* looks in $PLTCOLLECTS. Even if the<br>
> copy in /foo2/prelude.rkt is a badly formed module, and<br>
> /foo/imran/prelude.rkt is correct.<br>
><br>
> At least, thats what I discovered last night after installing from git :)<br>
><br>
> --<br>
> Regards,<br>
> Imran Rafique<br>
><br>
><br>
> On 19 January 2012 13:40, Eduardo Cavazos <<a href="mailto:wayo.cavazos@gmail.com">wayo.cavazos@gmail.com</a>> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> I've been testing out my MPL libraries with Racket 5.2 on Windows 7.<br>
>><br>
>> I generally use R6RS implementations and libraries. Thus, I tend to keep<br>
>> my library directories in "~/scheme" on Linux or "c:\users\myhomedir\scheme"<br>
>> on Windows. MPL has two dependencies (surfage and dharmalab; mentioned in<br>
>> the README) that should also be present in the library collection.<br>
>><br>
>> So to "install" MPL for Racket on Windows, I simply modified my<br>
>> PLTCOLLECTS environment variable. At first I simply defined it as:<br>
>><br>
>> c:\users\dharmatech\scheme<br>
>><br>
>> However, having only that directory in PLTCOLLECTS caused major problems<br>
>> for DrRacket.<br>
>><br>
>> My next step was to check the result of:<br>
>><br>
>> (get-collects-search-dirs)<br>
>><br>
>> and include those paths in PLTCOLLECTS as well. That seemed to do the<br>
>> trick. So my PLTCOLLECTS variable now looks like:<br>
>><br>
>> C:\Users\dharmatech\AppData\Roaming\Racket\5.2\collects;C:\Program Files<br>
>> (x86)\R<br>
>> acket\collects;c:\users\dharmatech\scheme<br>
>><br>
>> I'd like to provide some basic instructions in the README for getting<br>
>> started in a Windows environment with Racket and MPL. Should I suggest that<br>
>> the PLTCOLLECTS variable be modified as I've done above?<br>
>><br>
>> Section 6.1.3 of the Racket guide recommends using 'raco link' to install<br>
>> collections. Would this somehow be better than the PLTCOLLECTS approach? The<br>
>> drawback to this is that it appears that the user would have to 'raco link'<br>
>> all three library collections (i.e. surfage, dharmalab, mpl).<br>
>><br>
>> Once installed, MPL appears to function properly. The test suite passes<br>
>> when I run:<br>
>><br>
>> c:\Program Files (x86)\Racket>plt-r6rs<br>
>> c:\Users\dharmatech\scheme\mpl\test.sps<br>
>><br>
>> I recently added an '(mpl all)' library which exports commonly used<br>
>> procedures and macros. So to get a REPL up an running, in a DrRacket<br>
>> definitions window add:<br>
>><br>
>> #!r6rs<br>
>><br>
>> (import (mpl rnrs-sans)<br>
>> (mpl all))<br>
>><br>
>> hit "Run" and the MPL procedures/macros should available in the<br>
>> interactions window.<br>
>><br>
>> I normally write my Scheme code as R6RS libraries, not as Racket modules<br>
>> and I don't have much experience with the latter. It'd be nice if Racket<br>
>> module authors could import MPL libraries into their normal racket modules.<br>
>> Of course, MPL exports procedures that conflict naming-wise with traditional<br>
>> procedures like +, -, *, /, sin, cos, etc. How should I handle this in<br>
>> Racket modules? As a first attempt at mixing Racket and MPL I tried:<br>
>><br>
>> #lang racket<br>
>><br>
>> (require (lib "mpl/sum-product-power.sls"))<br>
>><br>
>> When I multiply 'x' times 'x' I get:<br>
>><br>
>> > (* 'x 'x)<br>
>> (mcons '^ (mcons 'x (mcons 2 '())))<br>
>><br>
>> In Petite Chez Scheme I get:<br>
>><br>
>> > (* 'x 'x)<br>
>> (^ x 2)<br>
>><br>
>> I guess the 'mcons' stuff is due to the mutable/immutable pairs difference<br>
>> between R6RS and default racket.<br>
>><br>
>> In R6RS, as shown above, I usually do '(import (mpl rnrs-sans) (mpl<br>
>> all))'. The library '(mpl rnrs-sans)' is equivalent to '(rnrs)' except for<br>
>> procedures which conflict name-wise with MPL procedures. Would you recommend<br>
>> setting up something similar for Racket so that the user can do:<br>
>><br>
>> #lang racket-sans<br>
>><br>
>> (require (lib "mpl/all.sls"))<br>
>><br>
>> Thanks for any hints and tips!<br>
>><br>
>> The MPL github project page is at:<br>
>><br>
>> <a href="https://github.com/dharmatech/mpl" target="_blank">https://github.com/dharmatech/mpl</a><br>
>><br>
>> Ed<br>
>> ____________________<br>
>> Racket Users list:<br>
>> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
><br>
><br>
><br>
> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
<a href="http://www.wisdomandwonder.com/" target="_blank">http://www.wisdomandwonder.com/</a><br>
ACM, AMA, COG, IEEE<br>
</font></span></blockquote></div><br></div>