One solution would be to have two versions of the case statement (case and caseunify), one that suspends if the pattern aribiter is not completely bound and one that does full unification.  Not only would that offer a nice feature, it would solve the problem that new-comers tend to get confused about this. If both language features were presented together in the documentation, there would be no confusion. 
 
-- Russ

 
On 9/25/05, Boriss Mejias <[EMAIL PROTECTED]> wrote:
Russ Abbott wrote:
> Would you point at bit more directly to where in the tutorial this is
> covered.
>
> What I have since decided is that pattern matching is not treated as
> general unification but is treated as an operation that suspends until
> the material to be matched is instantiated. This would parallel the
> situation in which other operations suspend until their arguments are
> instantiated. That makes sense in some cases, but I would prefer pattern
> matching to be general unification and to work even if the arguments are
> not instantiated.  Why not use the pattern matching step to instantiate
> some of the arguments?  That's one of the nice things about Prolog.

As you concluded, your "case" statement is blocking because variable C
is not bound yet to any value. A few weeks ago, there was some
discussion about it. You can follow it here:

http://www.mozart-oz.org/pipermail/mozart-users/2005/006739.html

Cheers
Boriss

>
>
> On 9/25/05, *Filip Konvicka*
> <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>      > In the following program, I'm trying to instantiate an output
>     variable
>      > in a case statement. I get output for {Browse start}, but I don't
>     get
>      > any other output.  Any idea why or where it is hanging?
>
>     Hi,
>
>      >
>      >         local Test
>      >            proc {P A B C}
>      >               {Browse start}
>      >               case A#B#C of
>      >           nil#B#B then {Browse first}
>
>     here, as Test (aka C) is unbound. You can not do such things with
>     "case". Read the tutorial carefully.
>
>     Cheers,
>     Filip
>
>      >               [] A#nil#A then {Browse second}
>      >               [] _#_#5 then {Browse neither}
>      >               end
>      >               {Browse after}
>      >            end
>      >         in
>      >            {P nil 3 Test}
>      >            {Browse Test}
>      >         end
>      >
>      >
>     _________________________________________________________________________________
>     mozart-users mailing list
>     [email protected] <mailto:[email protected]>
>     http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
>
>
>
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to