Skip to content

Commit

Permalink
correct write_src(s())
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Dec 28, 2024
1 parent 7aec151 commit c4a6394
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions prolog/metta_lang/metta_printer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,12 @@
pp_sexi_c((USER:Body)) :- fail,
% If `V` is in the format `user:Body`, process `Body` directly.
USER == user, !, pp_sex(Body).
pp_sexi_c(exec([H | T])) :-
pp_sexi_c(exec(S)) :-
% For `exec([H | T])` with a list `T`, print as `!` followed by `H` and `T`.
is_list(T), !, write('!'), pp_sex_l([H | T]).
pp_sexi_c('!'([H | T])) :-
!, write('!'), pp_sex(S).
pp_sexi_c('!'(S)) :-
% For `!([H | T])` with a list `T`, print as `!` followed by `H` and `T`.
is_list(T), !, write('!'), pp_sex_l([H | T]).
!, write('!'), pp_sex(S).
%pp_sexi_c([H|T]) :- is_list(T),!,unlooped_fbug(pp_sexi_c,pp_sex_l([H|T])).
pp_sexi_c([H | T]) :-
% If `V` is a list starting with `H`, print it as an S-expression list.
Expand Down Expand Up @@ -1106,7 +1106,7 @@
% For `N = V`, print in concept format if allowed.
allow_concepts, !, format("~N;; ~w == ~n", [N]), !, pp_sex(V).
%pp_sex_c(V):- writeq(V).
pp_sexi_c(Term) :-
pp_sexi_c(Term) :- fail,
% For `Term` with zero arity, format as a single symbol.
compound_name_arity(Term, F, 0), !, pp_sex_c([F]).

Expand Down
2 changes: 1 addition & 1 deletion prolog/metta_lang/metta_repl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@
!, inside_assert(I,O).
inside_assert(Eval,O) :-
% If the term is an evaluation, extract the relevant part and process it.
functor(Eval, eval_H, A), A1 is A - 1, arg(A1, Eval, I), !, inside_assert(I, O).
functor(Eval, eval_H, A, _), A1 is A - 1, arg(A1, Eval, I), !, inside_assert(I, O).
inside_assert(call(I),O) :-
% Handle call terms by processing the inside assertion.
!, inside_assert(I, O).
Expand Down
2 changes: 1 addition & 1 deletion prolog/metta_lang/metta_types.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,7 @@
is_user_defined_head0(Eq, Other, H) :-
% If the head is callable, extract its functor and check it.
callable(H), !,
functor(H, F, _),
functor(H, F, _, _),
is_user_defined_head_f(Eq, Other, F).
is_user_defined_head0(Eq, Other, H) :-
% Default case: directly check the head.
Expand Down

0 comments on commit c4a6394

Please sign in to comment.