[Bug 1705] [FS] technical: 5.2 Module Declaration: cyclical imports

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1705





------- Comment #15 from jmdyck@ibiblio.org  2006-10-17 01:18 -------
> Obviously, your proposed changes as adopted still need to be implemented.

But my proposed changes don't solve the original problem unless you require var
decls in library modules to have an explicit type, which Comment #6 indicates
you aren't going to do. So as far as I can tell, this is still an unsolved
problem.

Specifically, say you introduce a new auxiliary judgment for ECP:

    exportEnv1 |- PrologDecl =>export exportEnv2

(where the structure of an export environment is roughly a subset of the
structure of a static environment). Then the rule for a var decl *with* an
explicit type might be:

    exportEnv1 |- VarName of var expands to Variable
    Type = [[ SequenceType ]]_sequencetype
    exportEnv2 = exportEnv1 + varType( Variable => Type )
    ---------------------------------
    exportEnv1 |- declare variable $VarName as SequenceType := Expr 
                     =>export exportEnv2

(similar to 5.14 / SCP / rule 2), and that seems to work. But for a var decl
*without* an explicit type, you need something like:

    exportEnv1 |- VarName of var expands to Variable
    (( Type is the static type of Expr ))
    exportEnv2 = exportEnv1 + varType( Variable => Type )
    ---------------------------------
    exportEnv1 |- declare variable $VarName := Expr 
                     =>export exportEnv2

Now, for the real premise 2,
    exportEnv1 |- Expr : Type
won't work, because exportEnv deliberately excludes things that you might need
to statically type Expr. And if instead you try 
    statEnv |- Expr : Type
then where on earth does statEnv come from? Even if you do manage to say how
statEnv comes to the rule (with the appropriate value/content), it seems likely
that that would fall prey to the original M-N-L cycle.

(This isn't really new evidence, but perhaps it clarifies my earlier remarks,
and gives a more explicit framework on which to hang your response.)

Received on Tuesday, 17 October 2006 01:18:48 UTC