[m-dev.] for review: higher-order write_graph

Peter Ross peter.ross at miscrit.be
Wed Feb 28 04:06:08 AEDT 2001


On Wed, Feb 28, 2001 at 03:54:47AM +1100, Fergus Henderson wrote:
> On 27-Feb-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > On Wed, Feb 28, 2001 at 03:40:14AM +1100, Fergus Henderson wrote:
> > > On 27-Feb-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > >     Change build_dependency_graph so that it optionally also includes
> > > >     arcs to imported procedures.
> > > 
> > > That bit is problematic because it breaks the meaning of
> > > ensure_dependency_info.  Previously there was only one kind of
> > > dependency graph, and it was either valid or not, so
> > > ensure_dependency_info just needs to (re)make it if it is not valid.
> > > With your change, there are two kinds; probably the interface to
> > > ensure_dependency_info should change to indicate which kind of
> > > dependency info the caller wants, and if the currently stored one is
> > > not the right kind, ensure_dependency_info should recalculate it.
> > > 
> > The one calculated in the ensure_dependency_graph will always be the one
> > which doesn't include imported procedures (the original behaviour), for
> > the moment I will just change the documentation to reflect this.
> 
> What happens if someone calls build_dependency_graph
> with the option to include the imported procedures,
> and then later some code calls ensure_dependency_graph?
> Will the later code get the version that includes imported
> procedures?  
> 
> Unless the code is changed, I think it will, and I think
> that is likely to cause future problems.
> 
The only predicate which stores the dependency_graph in the module_info
is ensure_dependency_graph, and it only ever calls build_dependency_graph
with the bool set to yes.  Of course the user could call
build_dependency_graph and then module_info_set_dependency_info
themselves and break this invariant.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list