[mercury-users] hi & a feq queries

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Tue Aug 18 12:04:18 AEST 1998


Peter Schachte, you write:
> First of all, maintainability is not an issue in machine-generated code, so
> I still think generating an if-then-else is sensible in the case under
> discussion.

Granted.

> 
> Secondly, I don't understand your comment in this case.  I understand how a
> switch can help you maintain code when the switch covers all cases.  If you
> add an alternative to the switched-over type, the switch will change from
> det to semidet.  Great.  But we're talking about a switch with a default, so
> the switch part is already semidet.  I don't see how you could change a type
> so that a semidet disjunction is no longer semidet.

I'm thinking of the case of det -> multi or semidet -> nondet.
For example, having two different pieces of code to handle the
same situation. Once again, this is less likely to be a problem
in machine generated code (though a lex-like example comes to mind :
two token specifications that describe the same lexical construct
but turn it into different tokens eg:
	alpha alnum*	->	identifier
	...
	alpha alnum*	->	atom
).

Thomas
-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+



More information about the users mailing list