[m-dev.] Re: user-defined operators

Peter Schachte schachte at cs.mu.OZ.AU
Fri Jul 9 00:42:28 AEST 1999


> I have a suggestion.  Why not make pre/post/infix-ness a module-local
> property?

It's not really very user-friendly.  I know I'd find it annoying if in
order to use the predicates/functions in a module they way they are
described in the module documentation I not only had to import them
from the module that defines them, I also had to copy a bunch of
op declarations from the documentation into each of my source
modules.

As Fergus pointed out, it's a bit tricky to get the interaction
between ops and modules right.  OTOH, Mercury doesn't allow
reexportation, so it's not *that* hard.  In fact, Fergus, why isn't it
just a matter of making the interface-extraction code allow op
declarations to be included into the .int file if they appear in the
interface for a module?  I'd think that would handle public operators
right.

I guess there is still the question of how to handle importation of
two different modules that have incompatible operation declarations
for the same symbol.  Since operators are used as the lexical level,
before it's even known whether the symbol is a predicate, constructor,
or whatever, much less what the argument types are, it would be
impossible to use context to decide which of the conflicting op
declarations for the symbol to apply, so that problem seems
insurmountable.  But maybe that's forgivable, since user-defined
operators are occasionally so useful.  Are there any other hard
problems?

-- 
Peter Schachte                     Never doubt that a small group of
mailto:schachte at cs.mu.OZ.AU        thoughtful committed citizens can change
http://www.cs.mu.oz.au/~schachte/  the world, indeed it's the only thing
PGP: finger schachte at 128.250.37.3  that ever has. -- Margaret Mead 
--------------------------------------------------------------------------
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