[racket] Redefinitions in modules

From: Gustavo Massaccesi (gustavo at oma.org.ar)
Date: Tue Jan 10 15:51:22 EST 2012

I tried the following programs in DrRacket  5.2

;--- start
#lang racket/base
(define + -)
(+ 7 2)
;--- end
Result:
5
;---


;--- start
#lang racket/base
(require (only-in racket/base +))
(define + -)
(+ 7 2)
;--- end
Result:
[error] module: identifier is already imported in: +
;---


In the first example the function + is redefined. I expected to get an
error in both programs. I’m not sure if this is a bug or a feature.

(And I couldn’t find in the documentation which is the expected behavior.)

Gustavo



Posted on the users mailing list.