Re: How to fight semideterminism in Mercury?
From: Bart Demoen (bmd_at_cs.kuleuven.ac.be)
Date: 10/18/04
- Next message: Bart Demoen: "Re: List quastion"
- Previous message: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- In reply to: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- Next in thread: Dmitri Soshnikov: "Re: How to fight semideterminism in Mercury?"
- Reply: Dmitri Soshnikov: "Re: How to fight semideterminism in Mercury?"
- Reply: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 18 Oct 2004 10:46:29 +0200
Ralph Becket wrote:
> SOLUTION 2
>
> However, a simpler solution is to simply specify that your original
> add function always returns a non-empty AVL-tree:
[...]
>
> SOLUTION 3
>
> This is a bit of a hack, but if you stick to the if-then-else style
Ralph,
What you wrote seems to suggest that your solution 2 cannot be combined
with the if-then-else style without resorting to the hack. Is that true ?
You also wrote:
> Just as a point of style, it's usually preferable to use the built-in
> ordering function and a switch rather than if-then-elses:
Why is it preferable ? Is it shorter/clearer/conciser ... for the programmer ?
for any reader of the program ? Does the compiler do a better job in the
generated code ? Are more properties checkable by the compiler ? Are the
error messages better ?
Cheers
Bart
- Next message: Bart Demoen: "Re: List quastion"
- Previous message: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- In reply to: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- Next in thread: Dmitri Soshnikov: "Re: How to fight semideterminism in Mercury?"
- Reply: Dmitri Soshnikov: "Re: How to fight semideterminism in Mercury?"
- Reply: Ralph Becket: "Re: How to fight semideterminism in Mercury?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]