Skip to content

Commit

Permalink
fixed catch_nowarn
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Dec 14, 2024
1 parent b88e448 commit 1ace1f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mettalog
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ verbose="${VERBOSE:-0}" # Use the VERBOSE environment variable or default to '0
OUTPUT_DIR="${METTALOG_OUTPUT}"

cd $METTALOG_DIR
source ./scripts/ensure_venv
#source ./scripts/ensure_venv
cd $RPWD

use_docker=auto
Expand Down
8 changes: 4 additions & 4 deletions prolog/metta_lang/metta_eval.pl
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@
eval_until_unify(_Eq,_RetType,_Dpth,_Slf,X,X):- !.
eval_until_unify(Eq,RetType,Depth,Self,X,Y):- eval_until_eq(Eq,RetType,Depth,Self,X,Y),!.

eval_until_eq(_Eq,_RetType,_Dpth,_Slf,X,Y):- catch_nowarn(X=:=Y),!.
eval_until_eq(_Eq,_RetType,_Dpth,_Slf,X,Y):- catch_nowarn('#='(X,Y)),!.
eval_until_eq(_Eq,_RetType,_Dpth,_Slf,X,Y):- notrace(catch_nowarn(X=:=Y)),!.
eval_until_eq(_Eq,_RetType,_Dpth,_Slf,X,Y):- notrace(catch_nowarn('#='(X,Y))),!.
eval_until_eq(Eq,RetType,_Dpth,_Slf,X,Y):- X=Y,check_returnval(Eq,RetType,Y).
%eval_until_eq(Eq,RetType,Depth,Self,X,Y):- var(Y),!,eval_in_steps_or_same(Eq,RetType,Depth,Self,X,XX),Y=XX.
%eval_until_eq(Eq,RetType,Depth,Self,Y,X):- var(Y),!,eval_in_steps_or_same(Eq,RetType,Depth,Self,X,XX),Y=XX.
Expand Down Expand Up @@ -2517,9 +2517,9 @@




%catch_err(G,E,C):- catch(G,E,(always_rethrow(E)->(throw(E));C)).
catch_warn(G):- (catch_err(G,E,(fbug(catch_warn(G)-->E),fail))).
catch_nowarn(G):- (catch_err(G,error(_,_),fail)).
catch_nowarn(G):- catch(G,E,(always_rethrow(E)->(throw(E)),fail)).


% less Macro-ey Functions
Expand Down
3 changes: 2 additions & 1 deletion prolog/metta_lang/metta_utils.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,8 @@
always_rethrow(time_limit_exceeded).
always_rethrow(depth_limit_exceeded).
always_rethrow(restart_reading).
always_rethrow(E):- never_rrtrace,!,throw(E).
%always_rethrow(E):- never_rrtrace,!,throw(E).
%always_rethrow(_).

%! catch_non_abort(:Goal) is det.
%
Expand Down

0 comments on commit 1ace1f2

Please sign in to comment.