[m-dev.] cc_multi or det ?

Ralph Becket rbeck at microsoft.com
Tue Aug 7 01:05:47 AEST 2001


> From: Holger Krug [mailto:hkrug at rationalizer.com]
> Sent: 06 August 2001 15:51
> 
> I would ask Fergus to answer this mail.
> 
> Ralph and I incorporated exception handling code to lex.  A user
> defined function may throw an exception of type `lex__excn', which our
> code catches. The code then builds an error token out of the
> exception. Our user manual asks the user to throw exceptions in an
> unequivocal way. If the user follows our recommendation we can use
> `promise_only_solution', if not, the semantics would be undefined.

I'd go further and state that since the token_constructors are
functions,
the only situations where they should raise exceptions unexpectedly are
`uninteresting' ones such as running out of memory.  Otherwise raising
an
exception is fine.

The alternative it to make token_constructors return either ok(Token) or
error(Explanation), but that would complicate the interface without
gaining much.

- Ralph
--------------------------------------------------------------------------
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