Dear Torsten,
I agree with you, these combinators definitely lack documentation. But
here is how I found a solution to your problem: I simply looked at the
'Core Syntax' of you guarded or-statement:
or X=1 then Y=11
[] X=2 then Y=12
[] X=3 then Y=13
end
The statement is equivalent to
local
fun {C1} X=1 proc {$} Y=11 end end
fun {C2} X=2 proc {$} Y=12 end end
fun {C3} X=3 proc {$} Y=14 end end
in
{Combinator.'or' C1#C2#C3}
end
Now we can infer the rule: a guarded clause "A then B" is encapsulated
in a function that executes A and returns a procedure that encapsulates
B. In other words: fun {$} A (proc {$} B end) end.
I also checked the implementation of the combinator (its source code is
in the file share/lib/cp/Combinator.oz), and the rule above is correct.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users