Flush posted goals

From: masdeval <masdeval_at_yahoo.com.br>
Date: Tue 31 Aug 2004 08:18:10 PM GMT
Message-ID: <040301c48f97$a4d458f0$2806520a@cbraz>
    The program below gives the following results:
    
    Code 1 :
    post_goal (" assert( g(30) ) ");
    post_goal (" compile_term( p(X):- g(X) ) ");
    post_goal ( term( EC_functor("p",1), H ) );
    EC_resume();                      => H will take 30, there are no choicepoints or delayed goals 

    Code 2 :
    post_goal (" assert( g(40) ) ");
    post_goal (" compile_term( p(X):- g(X) ) ");
    post_goal ( term( EC_functor("p",1), W ) );
    EC_resume();                                            => W will take 30
    post_goal(" fail ");    
    post_goal ( term( EC_functor("p",1), W ) );     
    EC_resume();                                            => W will take 40
    
   How can i submit the code 2 and have only 40 as answer? I would like to make them independent from each other, i.e., after code 1 executes nothing about it remain in the eclipse. I have tried with once/1 and putting a "fail" between code 1 and code 2 but the results are the same. Are there some way to tell to eclipse flush everything posted to it until some moment?

    Thanks, 

    Christian
    
Received on Tue Aug 31 22:17:16 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:30 PM GMT GMT