Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:54:26+00:00 2026-06-15T06:54:26+00:00

I am going through SICP as a self-study and am on the picture language

  • 0

I am going through SICP as a self-study and am on the picture language section in Chapter 2. I have been using DrRacket for the earlier exercises, but I get compilation errors when trying to do an exercise based on the ‘draw-line’ picture function in this section of the book.

Specifically, this code …

(define (segments->painter segment-list)   
 (lambda (frame)     
  (for-each     
   (lambda (segment)        
    (draw-line         
     ((frame-coord-map frame) (start-segment segment))         
     ((frame-coord-map frame) (end-segment segment))))      
 segment-list)))

…produces this error …

draw-line: unbound identifier in module in: draw-line

So I did a bit of research on this forum and installed the SICP package that Neil Van Dyke offers (http://www.neilvandyke.org/racket-sicp/#(part._usage)). I followed all of the steps, changed the language to SICP as directed, but still get the same error.

I assumed that the purpose of this package was to have defined this ‘built-in’ function (as well as others in the book). Just to anticipate some questions, I do not have ‘require’ statements in the file and used ‘#lang planet neil/sicp’ to specify the language instead of using the menu (I also tried changing the language to SICP using the menu and get an even stranger error; see the postscript below). My environment is Windows 7 and the version of DrRacket is 5.3.1.

Perhaps I am just making a rookie mistake; any insight would be appreciated.

Thanks.

PS: For those interested, when I set the language to ‘SICP (PLaneT 1.17)’ using the menu, I get the following error for any definition that I try to compile (even the most trivial)…

<unsaved editor>:1:0: #%top-interaction: unbound identifier;
also, no #%app syntax transformer is bound in: #%top-interaction
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:54:27+00:00Added an answer on June 15, 2026 at 6:54 am

    In Racket, these definitions solved my problems with the drawings in chapter 2 of SICP, I solved successfully the exercises after that:

    (require graphics/graphics)
    (open-graphics)
    (define vp (open-viewport "A Picture Language" 500 500))
    
    (define draw (draw-viewport vp))
    (define (clear) ((clear-viewport vp)))
    (define line (draw-line vp))
    
    (define (make-vect x y)
      (cons x y))
    
    (define (xcor-vect v)
      (car v))
    
    (define (ycor-vect v)
      (cdr v))
    
    (define (add-vect v1 v2)
      (make-vect (+ (xcor-vect v1)
                    (xcor-vect v2))
                 (+ (ycor-vect v1)
                    (ycor-vect v2))))
    
    (define (sub-vect v1 v2)
      (make-vect (- (xcor-vect v1)
                    (xcor-vect v2))
                 (- (ycor-vect v1)
                    (ycor-vect v2))))
    
    (define (scale-vect s v)
      (make-vect (* s (xcor-vect v))
                 (* s (ycor-vect v))))
    
    
    (define (make-frame origin edge1 edge2)
      (list origin edge1 edge2))
    
    (define (origin-frame f)
      (car f))
    
    (define (edge1-frame f)
      (cadr f))
    
    (define (edge2-frame f)
      (caddr f))
    
    (define (frame-coord-map frame)
      (lambda (v)
        (add-vect
         (origin-frame frame)
         (add-vect (scale-vect (xcor-vect v)
                               (edge1-frame frame))
                   (scale-vect (ycor-vect v)
                               (edge2-frame frame))))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been reading through chapter 5 of sicp and have gotten stuck on a
Been going through some framework classes using reflector and noticed a number of the
Going through Lynda's 2010 tutorial on rails and have been stuck on migration for
I'm going through SICP and I'd like to have an interpreter analogous to the
Going through happstack-lite tutorial : we build functions that have return type of ServerPart
Going through the microsoft authentication tutorial listed here they have you create a master
While going through SWig generated wrappers, I find that the PInvokes don't have any
While going through some tutorials, I have encountered lines such as this: ((IDisposable)foo).Dispose(); Ignore
While going through the exercises, I came across something that, even after research, I
While going through one project, I have seen that the memory data is 8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.