[m-dev.] EDCGs

Peter Schachte schachte at cs.mu.OZ.AU
Tue Dec 21 18:15:24 AEDT 1999


On Tue, Dec 21, 1999 at 03:48:16PM +1100, Fergus Henderson wrote:
> > My "global variables" proposal, modified to suit Mercury
> >      -	necessary to look at declarations to see where some
> > 	information comes from and goes to
> 
> How does this one interact with overloading and type inference?

Type inference:  no problem inferring argument types; should be
possible to infer "global variable" types.  It's also possible to
infer which global variables need to be passed in and/or out of which
predicates (independent of type and mode inference).  I've implemented
that for Prolog.

Overloading:  fine as long as you're only trying to disambiguate based
on the (visible) arguments, not the global variables.  It would be
harder, and probably not too important, to disambiguate based on
global variable types.

It's actually higher-order code that presents the most trouble.  I
believe you need to extend the concept of a pred which already knows
how many extra arguments of which types to expect to include the
global variables it may use and those it may modify.  It may also need
to know which globals it will certainly modify before using.


-- 
Peter Schachte                     Behind every great fortune there is a
mailto:schachte at cs.mu.OZ.AU        crime.
http://www.cs.mu.oz.au/~schachte/      -- Honroe de Balzac 
PGP: finger schachte at 128.250.37.3  
--------------------------------------------------------------------------
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