Mutual open is ok for ordinary use. Howevere, care is necessary if a module definition includes top-level calls. Look at this example:
;; file a.jl (define-structure a (export aa) (open rep b) (define (aa))) ;; file b.jl (define-structure b (export) (open rep a) (aa)) ;; From somewhere (require 'a) ⇒ error: (void-value aa)
Let’s see step by step. File “a.jl” is read from the top. It
declares the symbol
aa is exported. Next, it opens
a, i.e. if a symbol
found, its value will be refered to
is evaluated. But its definition is not yet done, and it fails.
One solution is use of a hook; put the problematic evaluation into a hook, and call that hook later somewhere.