I'm still trying to use Oz like Prolog, and I'm still confused. For example, I was hoping that if X is unbound the following would bind it to elements of Xs.

   proc {IsMember X Xs}
      case Xs of
          Head | Tail then
         choice
           Head = X
         [] {IsMember X Tail}
         end
      end
   end
 
 
If I run
 
      {IsMember Y [1 2 3 4 5]}
      {Browse Y}
 
Ozcar tells me that I get to the 'end' at the bottom of the choice statement with X bound to 1.  At that point the thread turns yellow, saying that it is running.  What is it waiting for?
 
If instead I run

      {Browse {SearchAll proc {$ Y} {IsMember Y [1 2 3 4 5]} end}}
 
the thread turns yellow when it enters SearchAll.  Why don't I get all members of the list as the SearchAll answer?
 
Thanks.
 
-- Russ

--
_____________________________________________
Professor, Computer Science
California State University, Los Angeles
o Check out my blog at http://russabbott.blogspot.com/
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to