So, I guess my question is: Is it not possible to bind a top level
variable within Choice? I'm speculating that the choice doesn't
allow a bind, but rather goes into a wait until such time as the top
level space gets bound. But since the top level is waiting on the
choice to succeed, you go into a wait state.
The problem is not binding the global variable. The problem is
deciding whether the local computation space has failed.
...and this problem is caused by speculatively binding the global
variable in the local computation space, right?
Assuming that the state of the space depends on the value to which the
variable is bound outside (which is not always the case as shown in my
previous message).
That's what I meant by "speculative" :-)
Chris, if I understand your procedures correctly, the statement
Ss={SolveN 5 fun {$} {ListB 1|2|3|X} end}
tries bind X to 5 different tails at the same time, which can't be done.
I would re-phrase it as follows: it binds Ss to the first 5 solutions
that are consistent with the value given to X outside. As X can be only
bound to one value, Ss is at most a list of length 1. I say "at most"
because X could be bound to 'foo' and in that case Ss would be nil.
Yes, this is a better explanation. It helped me realize that the
approach can be actually used to constrain a global variable to a list,
as in
local
proc {IsList L}
choice
L=nil
[] _|T=L in {IsList T}
end
end
fun {EnsureList L}
proc {$ _}
{IsList L}
end
end
X
in
thread _|_={SearchAll {EnsureList X}} end
X=[a b c]
end
which is probably more sane than I originally thought it could be.
Thanks, Luis!
Cheers,
Filip
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users