Skip to content

Commit bea142a

Browse files
committed
fix for cons-atom not taking ()s
1 parent e06fd76 commit bea142a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

examples/games/TicTakToe.metta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,4 @@
229229
;; (is-human O)
230230

231231
!(play-now)
232-
!(repl!)
232+
; !(repl!)

prolog/metta_lang/metta_eval.pl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,16 +1930,14 @@
19301930
eval_20(_Eq,_RetType,_Depth,_Self,['decons-atom'|Args],[H,T]):- !,
19311931
arity_args(Args,[OneArg]), should_be(iz_conz,OneArg), must_unify(OneArg,[H|T]).
19321932
eval_20(_Eq,_RetType,_Depth,_Self,['cons-atom'|TwoArgs],[H|T]):-!,
1933-
arity_args(TwoArgs,[HH,TT]), should_be(iz_conz,TT),H=HH,T=TT,must_unify(TwoArgs,[H,T]).
1934-
1935-
1936-
1937-
should_be(P1,Term):- call(P1,Term)-> true ; (debug_info(compatability_warning,hyperon_throws_error(should_be(P1,Term))),fail).
1938-
1933+
arity_args(TwoArgs,[HH,TT]), should_be(is_list,TT),H=HH,T=TT,must_unify(TwoArgs,[H,T]).
19391934
% NEW
19401935
eval_20(_Eq,_RetType,_Depth,_Self,['decons',OneArg],[H,T]):- !, must_unify(OneArg,[H|T]).
19411936
eval_20(_Eq,_RetType,_Depth,_Self,['cons'|TwoArgs],[H|T]):-!, must_unify(TwoArgs,[H,T]).
19421937

1938+
1939+
should_be(P1,Term):- call(P1,Term).
1940+
19431941
%eval_20(Eq,RetType,Depth,Self,['get-doc'|Args],Res):- !,with_all_spaces(eval_args(Eq,RetType,Depth,Self,['metta-get-doc'|Args],Res)),!.
19441942
%eval_20(Eq,RetType,Depth,Self,['help!'|Args],Res):-!,with_all_spaces(eval_args(Eq,RetType,Depth,Self,['metta-help!'|Args],Res)),!.
19451943

0 commit comments

Comments
 (0)