[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: circular module uses



Gabor Greif wrote:
> If I have a library with three modules (sketch):
> 
> 
> define library L
>  use dylan;
> 
>    export a,b,c;
> end;
> 
> define module a
>    export xxx;
> end;
> 
> define module b
>   use a;
>   use c;
>    export yyy;
> end;
> 
> define module c
>    export zzz;
> end;
> 
> 
> Is it intended that module \b has access to \zzz from module \c ???
> 
> I.e. Is it admissible that modules of a library have circular (forward) use dependencies?

There's a forward reference here (where b uses c before the definition 
of c) but no circularity (since c doesn't use b).  Dylan implementations 
are encouraged to allow forward references as much as possible.  (I'm 
sure it says that somewhere in the DRM but I'm too lazy to look it up 
right now :-)


> My idea is that this should be allowed. Is there a reason to forbid it?

Your example should work (IMHO).


> GD does not complain about it at least, but does not see \zzz from inside \b either.
> I guess this is a bug.

That seems weird ... unless you've got some non-default "import:" 
clauses on the "use c;" in b's definition?

HTH,
Hugh