[racket] ufo structure problem

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Mon Apr 2 03:25:51 EDT 2012

On Fri, Mar 30, 2012 at 16:56, Roelof Wobben <r.wobben at home.nl> wrote:
> Op 30-3-2012 12:17, Pierpaolo Bernardi schreef:
>
>> On Fri, Mar 30, 2012 at 11:53, Roelof Wobben<r.wobben at home.nl>  wrote:
>>>
>>> Op 30-3-2012 9:46, Pierpaolo Bernardi schreef:
>>>
>>>> Hello Roelof,
>>>>
>>>> On Fri, Mar 30, 2012 at 09:32, Roelof Wobben<r.wobben at home.nl>    wrote:
>>>>
>>>>> (define (show-ufo ufo)
>>>>>  (place-image BLU (ufo-loc u) MTS))
>>>>>
>>>>> But still I can't get the show-ufo work.
>>>>
>>>> Check carefully the name of your variables!
>>>>
>>>> Doesn't DrRacket give you an explicative error message in this case?
>>>>
>>>> P.
>>>>
>>> Oke, I will do that.
>>>
>>> Yes, The error that variable u is not known.
>>
>> I didn't want to tease you.  I thought that you would see it if I
>> pointed you at it.  8^)
>>
>> (define (show-ufo ufo)
>>    (place-image BLU (ufo-loc u) MTS))
>>
>> See that the variables ufo and u should actually the same variable.
>> So, either you rename u to ufo, or rename ufo to u.
>
> Are you sure ?

Yes.

> I thought that the position of the ufo can be find at (posn-y p) and
> (posn-x) because the postition is a struct of Posn.

You must pay more attention to small details. What is the p in (posn-y
p)?  Isn't an argument missing in (posn-x)?
What is the u in (ufo-loc u)  (that's the variable that DrRacket says
it doesn't know).

P.


Posted on the users mailing list.