add read support for user:term_expansion and user:goal_expansion

This commit is contained in:
Mark Thom
2019-01-05 19:22:38 -07:00
parent 36fdc8e822
commit 042779cff9
7 changed files with 70 additions and 23 deletions

View File

@@ -16,7 +16,10 @@
instructions are unchanged. */
:- op(700, fx, non_counted_backtracking).
term_expansion((:- op(Pred, Spec, [Op | OtherOps])), OpResults) :-
% module resolution operator.
:- op(600, xfy, :).
user:term_expansion((:- op(Pred, Spec, [Op | OtherOps])), OpResults) :-
expand_op_list([Op | OtherOps], Pred, Spec, OpResults).
expand_op_list([], _, _, []).
@@ -47,9 +50,6 @@ expand_op_list([Op | OtherOps], Pred, Spec, [(:- op(Pred, Spec, Op)) | OtherResu
% term comparison.
:- op(700, xfx, [==, \==, @=<, @>=, @<, @>, =@=, \=@=]).
% module resolution operator.
:- op(600, xfy, :).
% the maximum arity flag. needs to be replaced with current_prolog_flag(max_arity, MAX_ARITY).
max_arity(63).