Thanks for the suggestions so far Filip!
The purpose of the choice statement is to express the
non-deterministic decision in the search tree. But what you are trying
to do is *enforce* one of the (two) branches. You can not use "choice"
for that.
Yes, I can see that "choice" implements PURE non-determinism, and so is
not really suitable. The question is what WOULD be suitable to enforce
the second branch, dependant on the success/failure of the first.
Yves Jaradine suggested I look into "cond". I must really go and study
that Chapter 12 now!!! I should have done it ages ago. :)
The solution to your problem depends on the complexity of the Corresp
procedure.
You can see it in my code.
http://aegean.pwp.blueyonder.co.uk/store/tel.oz It's not complex, in
fact its a bit of a dummy function. I already have all possibilities as
a list from the lookup, "Corresp" simply uses MemeberND, to dish them
out as choices, so that the prog keeps its simple declarative form.
Well, I don't see any need for nondeterminism in that. It can be simply
done using
ValueList={Dictionary.condGet MyDict First nil}
if ValueList\=nil then
.... (pick one of ValueList non-deterministically)
else
....
end
But chapter 12 is still worth reading :-)
Cheers,
Filip
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users