Jorge Marques Pelizzoni <[EMAIL PROTECTED]> writes:

> Strangest behaviour can be observed by executing either of the following
> procedures:
>
> -------------
> declare
> proc {Test1}
>    X = {FS.var.decl}
> in
>    {Browse X == unit} %% passes
>    {Browse {IsFree X}}
>    {Browse passed}
>    thread if X == unit then {Browse ok1} end end
>    thread if {IsFree X} then {Browse ok2} end end

try this instead:

     thread if X == unit then skip else {Browse ok1} end end
     thread if {IsFree X} then skip else {Browse ok2} end end

:-)

> end
> proc {Test2}
>    X = {FS.var.decl}
> in
>    {Browse X == unit}
>    {Browse {IsUnit X}}
> end

IsUnit is documented as {IsUnit +X ?B} i.e. it synchronizes on determinacy of
its argument.  This is the way type checking primitives work (and no, the
ill-named FD.is is not a type-checking primitive).  You may be interested in
Value.status.

> By the way, I
> guess some primitive WaitNotFree would be rather interesting, because our
> current {Wait} means actually {WaitDet}. Ah, even {System.eq X unit} blocks...

Indeed, I suggested before that we are missing a WaitKinded primitive:

        http://www.mozart-oz.org/pipermail/mozart-users/2002/003032.html

the need never seemed pressing enough to act on the suggestion ;-)

Cheers,

--Denys
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to