[m-dev.] switches

Ralph Becket rafe at cs.mu.OZ.AU
Tue Aug 23 09:53:27 AEST 2005


Ian MacLarty, Monday, 22 August 2005:
> Hello,
> 
> Would there be an issue with transforming code like the following:
> 
> p(X, Y) :-
> 	(
> 		(X = a ; X = b),
> 		q(X, Y)
> 	;
> 		(X = c ; X = d),
> 		r(X, Y)
> 	).
> 
> into the following:
> 
> p(X, Y) :-
> 	(
> 		X = a,
> 		q(X, Y)
> 	;
> 		X = b,
> 		q(X, Y)
> 	;
> 		X = c,
> 		r(X, Y)
> 	;
> 		X = d,
> 		r(X, Y)
> 	).
> 
> before switch detection?

I wouldn't object: this would be useful and I can't think of many
occasions (if any) in the past where this would lead to a code
explosion.

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