The number of times that a phase 1 module is required is not easy to
predict because it depends on how the program is run. But yes, state
is not shared unless the state is external (network connections, IO
(like you see here), files in the file system).

Robby


On Thu, Sep 24, 2015 at 10:46 PM, Thomas Lynch
<[email protected]> wrote:
> Darn, It is not due to copy and paste, but rather due to a module in the
> require chain using require for syntax. Details and questions follow.
>
> So here we enter extentions-lib.  This causes the test-lib to be initialized
> three times:
>
> racket@> (enter! "extentions-lib.rkt")
> "intializing test-lib.rkt module"
> "intializing test-lib.rkt module"
> "intializing test-lib.rkt module"
>
>
> extension-lib.rkt:
>
> #lang racket
>
>   (require "test-lib.rkt")
>   (require "arith-lib.rkt")
>   (require (for-syntax "arith-lib.rkt"))
>
> arith-lib.rkt:
>
> #lang racket
>   (require "test-lib.rkt")
>
>
> test-lib.rkt:
>
> #lang racket
> "intializing test-lib.rkt module"
>
> How is it that test-lib.rkt is initialized three times?  I get two times,
> the 'for syntax' time and the regular time.
>
> Going back and looking at the actual program, it does seem that the test
> list available for invocation at run time is the correct one, and the
> interspersed require for syntax inits did not share state.   However, the
> transcript is messed up, because the messages from all the inits are dumped
> in, independent of the phase of the initialization.  I'm going to need a
> 'this is not phase zero'  flag and conditional behavior for the test code.
> How is that done?
>
> Also interesting apparently phase 1 is not a distinct phase that occurs
> before phase 0, but rather it is jumping back and fourth.  Is that correct?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-dev/09063244-078b-468c-ae76-856696eaae47%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAL3TdOOLR%2Bn-5cSora9cxmdtZZ-r_K-Pugi9d7fcw4ABKu3E3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to