I want to find the width of this image, why it says unbound identifier?

38 views
Skip to first unread message

Yi Chen

unread,
Dec 5, 2020, 10:26:30 PM12/5/20
to Racket Users

George Neuner

unread,
Dec 6, 2020, 2:47:31 AM12/6/20
to racket...@googlegroups.com
On Sat, 5 Dec 2020 19:26:30 -0800 (PST), Yi Chen
<cy691...@gmail.com> wrote:

> #lang slideshow
> (define cat <some_picture>)
> (image-width (cat))

There is no function "image-width" in slideshow.

see: https://docs.racket-lang.org/search/index.html?q=image-width
To use "image-width" you must require one of these library modules:
- htdp/image
- 2htdp/image
- quadwriter


Additionally your syntax is wrong: it should be "(image-width cat)".
With the parentheses, "(cat)" is a call of a function named "cat" -
however "cat" is not a function but simply an image.

Hope this helps,
George

Yi Chen

unread,
Dec 6, 2020, 3:02:27 AM12/6/20
to Racket Users
 it helps a lot. Thx, have a nice day -:)
Reply all
Reply to author
Forward
0 new messages