[m-dev.] for review: add mdb support for interactive queries
Peter Schachte
schachte at cs.mu.OZ.AU
Fri Mar 5 08:34:11 AEDT 1999
On Fri, Mar 05, 1999 at 05:06:17AM +1100, Fergus Henderson wrote:
> You can have module-qualified predicate calls, but then what
> do we do about goals such as `?- m1:foo, m2:bar.'?
I assume you mean when neither foo nor bar is exported from its
module? Not much you can do with this implementation technique, is
there? But such goals make perfect sense, and some debugger
implementation techniques would allow them. Also, in the case where
one of them is exported, you could choose to nest this query in the
other module and import that module.
So the scheme that would make sense to me is, perhaps not
coincidentally, what Prolog does (at least Quintus Prolog): have a
command to change the default module for non-module-qualified atoms to
some named module, and allow module qualified atoms. When you read a
query, you apply the default module to build a fully qualified goal.
After that, you look to see if there is more than one non-exported
atom, and if so report an implementation limitation error. If there's
exactly one non-exported atom, you nest the query in that module and
import all the other mentioned modules. If there are no non-exported
atoms, then just create a query module and import all the mentioned
modules. This takes a bit of poking around in interface files, but
each one only needs to be read once, the first time that module is
mentioned.
--
Peter Schachte Opportunities multiply as they are seized.
mailto:schachte at cs.mu.OZ.AU -- Sun Tzu
http://www.cs.mu.oz.au/~schachte/
PGP: finger schachte at 128.250.37.3
More information about the developers
mailing list