[mercury-users] Request for comments on this code

Peter Schachte schachte at csse.unimelb.edu.au
Tue Jul 11 18:13:29 AEST 2006


On Tue, Jul 11, 2006 at 01:47:42PM +1000, Julien Fischer wrote:
> On Mon, 10 Jul 2006, Peter Schachte wrote:
> >With && you're saying the code is pure and
> >order doesn't matter, but just for operational reasons we want the
> >code before the && to complete before starting the code after it.  But
> >in that case, why is this so rigid?  Isn't && only advisory?
> 
> What would be the point of it if it were only advisory?

Telling Mercury a preferred order for two goals.  A suggestion to the
compiler.

I guess the question really is to what extent you trust the compiler.
If the compiler gets clever and discovers that in some mode it's
better to execute those goals in the opposite order, why shouldn't it
reorder them?  We're stipulating that this isn't a question of
correctness, just performance.  And if you've specified a mode for a
predicate that requires the goals be reordered, I'd rather have it
reorder the goals, perhaps with a warning, than to refuse to compile.

What do you want && for?

-- 
Peter Schachte              The trouble with Communism is the Communists,
schachte at cs.mu.OZ.AU        just as the trouble with Christianity is the
www.cs.mu.oz.au/~schachte/  Christians.
Phone: +61 3 8344 1338          -- H.L. Mencken 
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at csse.unimelb.edu.au
administrative address: owner-mercury-users at csse.unimelb.edu.au
unsubscribe: Address: mercury-users-request at csse.unimelb.edu.au Message: unsubscribe
subscribe:   Address: mercury-users-request at csse.unimelb.edu.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list