[mercury-users] Mutually exclusive goals

Thomas Conway conway at cs.mu.OZ.AU
Mon Aug 9 09:00:43 AEST 1999


On Sat, Aug 07, 1999 at 11:34:57AM EST, Fergus Henderson wrote:
> On 16-Jul-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> > It would be instructive to go through a large body of Mercury code,
> > (eg, the Mercury compiler) looking for code that works around this
> > problem.  It shouldn't be too hard to find places where exhaustiveness
> > declarations are needed, because they should have funny error goals
> > saying that the error should never happen.  I suspect that trying to
> > find places where exclusiveness declarations would help would be
> > pretty hard because they're probably all hacked around to make them
> > det.
> > 
> > Any Mercury hackers care to post some examples of where exclusivity or
> > exhaustiveness declarations would have helped?
> 
> Most of the calls to error/1 in the Mercury compiler come from places
> where there are additional constraints on the input arguments which
> the type system cannot express, e.g. that two lists must have the same
> length.  I don't think there would be many examples of where exhaustiveness
> might have helped; off-hand, I can't think of any.

There are plenty of times when I've needed a switch on an int or a
string where an enumeration was not ideal (eg integer ranges).

Thomas
-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list