Skip to content

Commit

Permalink
simplified read_metta
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Dec 28, 2024
1 parent 4366e68 commit 977f5d0
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 1,095 deletions.
5 changes: 1 addition & 4 deletions prolog/metta_lang/metta_compiler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,6 @@



subst_varnames(Convert,Converted):-
subst_vars(Convert,Converted,[], NVL),
memorize_varnames(NVL).


cns:attr_unify_hook(_V,_T):- true.

Expand Down Expand Up @@ -2196,6 +2192,7 @@
is_compiled_and(AND):- member(AND,[ (','), ('and'), ('and-seq')]).

flowc.

unnumbervars_clause(Cl,ClU):-
copy_term_nat(Cl,AC),unnumbervars(AC,UA),copy_term_nat(UA,ClU).
% ===============================
Expand Down
2 changes: 1 addition & 1 deletion prolog/metta_lang/metta_eval.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@

eval_20( Eq, RetType, Depth, Self, [ 'parse' , L ] , Exp ):- !,
eval_args( Eq, RetType, Depth, Self, L, Str ),
once(parse_sexpr_metta1( Str, Exp )).
once(read_metta( Str, Exp )).

eval_20( _Eq, _RetType, _Depth, _Self, [ 'repr' , L ] , Sxx ):- !,
%eval_args( Eq, RetType, Depth, Self, L, Lis2 ),
Expand Down
5 changes: 2 additions & 3 deletions prolog/metta_lang/metta_interp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@

set_metta_argv(Before):- maplist(read_argv,Before,Args),set_prolog_flag(metta_argv, Args),!.
read_argv(AArg,Arg):- \+ symbol(AArg),!,AArg=Arg.
read_argv(AArg,Arg):- atom_string(AArg,S),read_metta(S,Arg),!.
read_argv(AArg,Arg):- atom_string(AArg,S),read_sexpr(S,Arg),!.


metta_cmd_args(Args):- current_prolog_flag(mettalog_rt, true),!,mettalog_rt_args(Args).
Expand Down Expand Up @@ -1770,8 +1770,7 @@
convert_tax(Mode,Self,NewTax,Expr,NewHow).
convert_tax(How,_Self,Tax,Expr,How):-
%parse_sexpr_metta(Tax,Expr).
normalize_space(string(NewTax),Tax),
parse_sexpr_metta1(NewTax,Expr).
read_metta(Tax,Expr).

%:- if( \+ current_predicate(notrace/1) ).
% notrace(G):- once(G).
Expand Down
Loading

0 comments on commit 977f5d0

Please sign in to comment.