[m-dev.] cc_multi or det ?

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Aug 7 02:05:53 AEST 2001


On 06-Aug-2001, Holger Krug <hkrug at rationalizer.com> wrote:
> On Tue, Aug 07, 2001 at 01:48:14AM +1000, Fergus Henderson wrote:
> > 
> > 	Will that work?
>  
> Won't work.
>  
> > 	If not, why not? 
> 
> Because the question is posed this way.
> 
> > 	(What case could cause problems?)
>  
> Mantissa and exponent both out of range. Only one exception will be thrown
> (hence `det'), but it's not clear which one (hence `multi'), gives:
>    `cc_multi'

Right.

> > 	Was the problem easy to spot or hard to spot?

Obviously easy for Holger Krug, at least in this context.

But I suspect that this is the kind of mistake which many users might
make without even realizing it, especially if the det lex__main procedure
is named in a way that doesn't hint at the danger.

Ralph's other suggestion -- of having the lexer token constructors just
return some special token value which gets passed up to the parser,
rather than throwing an exception -- side-steps the whole issue and
sounds like a better approach to me.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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