Yes, that's as intended. Reloading the file redeclares the submodule, and when an instantiated module (or submodule) is redeclared, then its body is reevaluated.
I'm not sure the behavior is desirable, but I also don't how different behavior could be arranged. At Tue, 25 Jun 2013 06:48:28 -0300, Diogo F. S. Ramos wrote: > When entering a file from a submodule inside this file, the submodule > seems to be evaluated again. Is this the intended behavior? > > Here are the steps to reproduce it: > > 1. Create a file with a submodule inside it > 2. Enter file > 3. Enter submodule > 4. Change the file and save it > 5. Enter the file > > Here is a example program: > > #lang racket/base > > (module my-submodule racket/base > (displayln "inside my-submodule")) > > And here is the interaction with this file: > > $ racket > Welcome to Racket v5.3.4. > > (enter! "foo.rkt") > > (enter! (submod "foo.rkt" my-submodule)) > inside my-submodule > > (enter! "foo.rkt") > [re-loading /tmp/foo.rkt] > inside my-submodule > > > > As one can see, the message "inside my-submodule" is printed again when > entering "foo.rkt". > ____________________ > Racket Users list: > http://lists.racket-lang.org/users ____________________ Racket Users list: http://lists.racket-lang.org/users