scola
scola

Reputation: 11

Racket error - module: identifier already required

Am getting the following error when trying to run (require 2htdp/image) in DrRacket:

module: identifier already required

The error occurs after updating from DrRacket 7.3 to 7.4.

I uninstalled all previous versions of DrRacket including 7.4 and reinstalled 7.3. Am continuing to get error.

I went through some of the solutions in stackoverflow for this error message before posting. However, my code is simple. I cannot even run (require 2htdp/image) on its own without code without triggering the error.

[edit]

Check-syntax:

unsaved-editor:2:9: module: identifier already required in: rectangle

I have no idea what that means, since there is no rectangle attached to this test.

[edit]

Language: Beginning Student [custom]; memory limit: 128 MB.
Teachpack: world.rkt.

Upvotes: 1

Views: 1720

Answers (1)

tjorchrt
tjorchrt

Reputation: 702

it's means you added teachpack (*.rkt) has same function name "rectangle". just clear teachpacks only add you really needed teachpacks

(require 2htdp/image) "image.rkt" have function rectangle.

(require htdp/world) "world.rkt" also have function rectangle.

In same folder create a.rkt b.rkt c.rkt

create file a.rkt

#lang racket
(provide t)
(define (t x) (+ x 1))

create file b.rkt

#lang racket
(provide t)
(define (t x) (+ x 2))

create file c.rkt

#lang racket
(require (file "a.rkt"))
(require (file "b.rkt"))
(t 3)

run c.rkt will shows

module: identifier already required in: t

Upvotes: 4

Related Questions