[racket] new to Scheme and functional programming- weird error I can't wrap my mind around
Currently going through DrRacket's "draw.ss" teachpack.
There is a structure called "posn" defined in the following way.
*(struct posn (x y))*
*
*
Also a function that returns a posn defined as:
*(define (make-posn x y)*
* (posn x y))*
*
*
Using the draw-circle function defined in draw.ss, I wanted to draw a green
circle centered at (posn 150 150), with radius 20.
*
*
> (draw-circle (make-posn 150 150) 20 'green)
. . draw-circle: expects a posn as first argument, given #<posn>
I don't understand the above error. Draw-circle expects a posn structure,
and DrRacket recognized that I gave it one. So where did the error stem
from?
Regards,
Chun How
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111115/28691d52/attachment.html>