Philip McGrath schreef op zo 27-03-2022 om 10:12 [-0400]: > Oh, wow. I definitely had not realized that, *even inside a > declarative > module*, a reference to a variable with no statically visible > definition > would semantically be a dynamic lookup in a mutable environment at > runtime (rather than a compile-time error), though I do see now that > `info guile declarative` does indeed say that marking a module as > declarative "applies only to the subset of top-level definitions that > are themselves declarative: those that are defined within the > compilation unit, and not assigned (‘set!’) or redefined within the > compilation unit." > > Does this mean that Guile treats all imported bindings as non- > declarative? > This seems like a big barrier to cross-module inlining, though IIUC > Guile > currently doesn't do much of that by default (maybe for this reason). To my understanding, declarative modules are orthogonal to circular imports. All declarative modules do, is telling the Guile compiler that ‘yes, inlining is fine, I won't change the value of these top- level variables’. Declarativity does not change the module variable lookup system and module loading system, it only changes the set of optimisations. Greetings, Maxime.