https://www.gimp.org/tutorials/Basic_Scheme2/ -- code example corrections
;the changes necessary to correct the script :Basic Scheme 2" tutorial script are indicated with three semi-colons (;;;)
(set! image (car (gimp-image-new 320 240 RGB))) ; images need layers
(set! layer
(car
(gimp-layer-new
image 320 240 RGB-IMAGE "layer" 100.0 0))) ;;; changed from typo RGB_IMAGE
(gimp-image-add-layer image layer -1) ; display our image
(set! window (car (gimp-display-new image)))
(gimp-edit-clear layer) ; let's draw
(set! points (cons-array 4 'double))
(aset points 0 0) ; (x0, y0)
(aset points 1 0)
(aset points 2 320) ; (x1, y1)
(aset points 3 240)
(gimp-palette-set-foreground '(255 0 0))
(gimp-paintbrush-default layer 4 points)
; create an image
(define image) ;;; define the two variables
(define layer) ;;; otherwise: Error: set!: unbound variable: image/layer