Russ Abbott writes:
> When I run the following, I get
>
> a#a
> b#b
>
> So the proc completes twice, once with each value as expected. But SearchAll
> suspends. Why?
>
> local
> X
> in
> {Browse
> {SearchAll
> proc {$ Y}
> choice Y = a [] Y = b end
> Y = X
> {Browse X#Y}
> end}}
> end
>
Because X is *external* to the search. The search can't commit to
either alternative until it knows the value of X. Try this:
declare
X
{System.show
{SearchAll
proc {$ Y}
choice Y = a [] Y = b end
Y = X
{Browse X#Y}
end}}
You see the two alternatives, as before, but SearchAll is blocked
waiting to know more about the value of X, now feed:
X=a
and you will see the search complete with
[a]
I presume this is the same as in your previous messages (I only
checked the original Append example).
If you use the Explorer (ExploreAll instead of {System.show {SearchAll
...) you can see the state of the search.
k
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users