What is the error in the following racket code?

1.3k Views Asked by At
;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

1

There are 1 best solutions below

1
On

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