[racket] DrRacket and Modules

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Mon Aug 15 09:31:43 EDT 2011

At Mon, 15 Aug 2011 10:56:52 +0200,
Jos Koot wrote:
> About (define cons 1). Originally this was not permitted. On my request this
> was permitted more than a year ago. The remark in the guide must be a left
> over of old times. The reason I asked for this change is the following:
> suppose you have a module that imports racket and defines a variable
> some-name. Now if racket is extended to export a variable of the same name,
> your module would no longer work. It is a matter of scope. It remains
> prohibited to import the same variable from two different modules.

You can shadow bindings that you get from your language, but not those
that you get from your requires. For example, this works:

    #lang racket
    (define cons 1)

But this doesn't:

    #lang racket
    (require racket)
    (define cons 1)

If `racket' starts exporting bindings whose names clash with yours,
you're still fine if you use `#lang racket', but not if you use
`(require racket)'.


Posted on the users mailing list.