<div dir="ltr"><div><div><div><div>Ok, I'm stuck again:<br></div>I'm trying to use place-image, but it keeps saying <br>place-images: unbound identifier in module in: place-images<br><br></div>It doesn't even seem to work with the example code in the docs found at:<br><a href="http://docs.racket-lang.org/teachpack/2htdpimage.html?q=overlay#%28def._%28%28lib._2htdp%2Fimage..rkt%29._place-images%29%29">http://docs.racket-lang.org/teachpack/2htdpimage.html?q=overlay#%28def._%28%28lib._2htdp%2Fimage..rkt%29._place-images%29%29</a><br><br></div>Here's what I think the docs say the code is:<br>#lang racket<br>(require 2htdp/universe)<br>(require 2htdp/image)<br>(require lang/posn)<br>(place-images<br>   (list (circle 4 "solid" "blue")<br>         (circle 4 "solid" "white")<br>         (circle 4 "solid" "white")<br>         (circle 4 "solid" "white"))<br>   (list (make-posn 18 20)<br>         (make-posn 0 6)<br>         (make-posn 14 2)<br>         (make-posn 8 14))<br>   (rectangle 24 24 "solid" "goldenrod"))<br><br></div>But like I said, I get the error.  I'm trying to use place-images to place a bunch of sprite images on a scene for a simple video game.  I'm assuming place-images the best way to do that.<br><br>Thanks in advance for helping me out.  I know it's basic stuff.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 9:04 AM, Andrew Ulrich <span dir="ltr"><<a href="mailto:andrewsotheraccount@gmail.com" target="_blank">andrewsotheraccount@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Aha, great! Thanks guys!<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br>Andrew<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 8:54 AM, Jens Axel Søgaard <span dir="ltr"><<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrew,<br>
<br>
To add what Matthias say, if you need a "function version" of bitmap,<br>
you can use bitmap/file instead.<br>
<span><br>
    (require 2htdp/image)<br>
    (define path-stringy "images/some.png")<br>
</span>    (bitmap/file path-stringy)<br>
<br>
Note that I changed (path-stringy) to path-stringy.<br>
<br>
/Jens Axel<br>
<div><div><br>
<br>
<br>
<br>
2014-10-04 15:48 GMT+02:00 Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>>:<br>
><br>
> What you used is called a "computed string" that is, you expect bitmap to evaluate the argument path-stringy to a string.<br>
><br>
> But, in BSL, bitmap expects to be handed a literal string constant (or a module path):<br>
><br>
> ---------------------------------------------------------------------<br>
> (require 2htdp/image)<br>
><br>
> ;; with a module path<br>
> (bitmap 2htdp/planetcute/character-cat-girl.png)<br>
><br>
> ;; with a fixed string<br>
> (bitmap "plt/pkgs/htdp-pkgs/htdp-lib/2htdp/planetcute/character-cat-girl.png")<br>
> ---------------------------------------------------------------------<br>
><br>
> Both of these will succeed and retrieve the cat girl from the Planet Cute collection that comes with Racket -- Matthias<br>
><br>
><br>
><br>
><br>
> On Oct 4, 2014, at 9:36 AM, Andrew Ulrich wrote:<br>
><br>
>> Hi, I've got a really simple problem, I think.  Why is it that when I try to do the following:<br>
>><br>
>> (require 2htdp/image)<br>
>> (define path-stringy "images/some.png")<br>
>> (bitmap (path-stringy))<br>
>><br>
>> I get the following error:<br>
>>  bitmap: expected the argument to specify a local path (via a string) or a module path (e.g. `icons/b-run.png') in: (bitmap (path-stringy))<br>
>><br>
>> I mean, shouldn't path-stringy evaluate to a string before it's passed into bitmap?  If not, then how do I use bitmap for anything dynamic?<br>
>><br>
>> Thanks,<br>
>> Andrew<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>
>   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>
</div></div><span><font color="#888888">--<br>
--<br>
Jens Axel Søgaard<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>