rajdeep04
rajdeep04

Reputation: 17

What is the error in the following racket code?

;creating traffic signal image 
(require 2htdp/image)

(define (bulb c)
  (circle 10 "solid" c))

(above (bulb "red")
       (bulb "yellow")
       (bulb "green"))

The Error Displayed is:. Module Language: there can only be one expression in the definitions window in: (define (bulb c) (circle 10 "solid" c))

Interactions disabled. ///I can't figure out the error

Upvotes: 2

Views: 1448

Answers (1)

Andrea Gottardo
Andrea Gottardo

Reputation: 1369

DrRacket is failing to recognize the language being used in your code. You need to choose a language manually. It looks like you are following the first chapters of the HtDP textbook, so I recommend going for the Beginning Student Language. You can do so by:

  • adding #lang htdp/bsl at the beginning of your file
  • using the picker at the bottom of the DrRacket window:

DrRacket language picker

Upvotes: 2

Related Questions