[racket] compile-enforce-module-constants parameter and redefinition of constants

From: Harry Spier (vasishtha.spier at gmail.com)
Date: Wed Dec 21 23:16:04 EST 2011

Can someone explain why this example from the Racket Guide allows a
re-definition of a constant but the second case (not from the Racket
Guide) gives an error. Both are executed in the interactions window of
DrRacket.

Many thanks,
Harry

> (compile-enforce-module-constants #f)
> (module m2 racket
    (provide pie)
    (define pie 3.141597))
> (require 'm2)
> (module m2 racket
    (provide pie)
    (define pie 3))
> pie
3
>


BUT

> (compile-enforce-module-constants #f)
> (module m2 racket
    (provide pie)
    (define pie 3)
    (define pie 4))
.
gives the error:  module: duplicate definition for identifier in: pie
>


Posted on the users mailing list.