| 3156 | | % '$lgt_call_ctg_pred'(+atom, +atom, +callable, +object_identifier, +object_identifier, +object_identifier) |
| 3157 | | % |
| 3158 | | % calls a category predicate directly, without using the message sending mechanism |
| 3159 | | |
| 3160 | | '$lgt_call_ctg_pred'(Dcl, Def, Pred, Sender, This, Self) :- |
| | 3156 | % '$lgt_call_pred_from_this'(+atom, +object_identifier, +atom, +atom, +callable, +object_identifier, +object_identifier, +object_identifier) |
| | 3157 | % '$lgt_call_pred_from_this'(+atom, +category_identifier, +atom, +atom, +callable, +object_identifier, +object_identifier, +object_identifier) |
| | 3158 | % |
| | 3159 | % calls a predicate from "this", without using the message sending mechanism |
| | 3160 | % prevent loops by ensuring that we look for an inherited or imported definition |
| | 3161 | |
| | 3162 | '$lgt_call_pred_from_this'(object, Obj, Dcl, Def, Pred, Sender, This, Self) :- |
| 3162 | | ( '$lgt_imports_category_'(This, Ctg, _), |
| 3163 | | call_with_args(Def, Pred, Sender, This, Self, Call, Ctg) -> |
| | 3164 | ( call_with_args(Def, Pred, Sender, This, Self, Call, Ctn), Obj \= Ctn -> |
| | 3165 | call(Call) |
| | 3166 | ) |
| | 3167 | ; throw(error(existence_error(predicate_declaration, Pred), ':'(Pred), This)) |
| | 3168 | ). |
| | 3169 | |
| | 3170 | '$lgt_call_pred_from_this'(category, Ctg, Dcl, Def, Pred, Sender, This, Self) :- |
| | 3171 | ( call_with_args(Dcl, Pred, _, _, _, _, _, _) -> |
| | 3172 | ( call_with_args(Def, Pred, Sender, This, Self, Call, Ctn), Ctg \= Ctn -> |
| | 6935 | \+ '$lgt_pp_extended_category_'(_, _, _, _, _), |
| | 6936 | \+ '$lgt_pp_extended_object_'(_, _, _, _, _, _, _, _, _, _), |
| | 6937 | \+ '$lgt_pp_instantiated_class_'(_, _, _, _, _, _, _, _, _, _), |
| | 6938 | \+ '$lgt_pp_specialized_class_'(_, _, _, _, _, _, _, _, _, _), |
| 6941 | 6954 | ( ('$lgt_pp_instantiated_class_'(_, _, _, _, _, _, _, _, _, _); '$lgt_pp_specialized_class_'(_, _, _, _, _, _, _, _, _, _)) -> |
| 6942 | | TPred = '$lgt_call_ctg_pred'(IDcl, Def, Pred, Sender, This, Self) |
| 6943 | | ; TPred = '$lgt_call_ctg_pred'(Dcl, Def, Pred, Sender, This, Self) |
| | 6955 | TPred = '$lgt_call_pred_from_this'(object, Obj, IDcl, IDef, Pred, Sender, This, Self) |
| | 6956 | ; TPred = '$lgt_call_pred_from_this'(object, Obj, Dcl, Def, Pred, Sender, This, Self) |
| | 6958 | ). |
| | 6959 | |
| | 6960 | '$lgt_tr_body'(':'(Alias), TPred, '$lgt_dbg_goal'(':'(Alias), TPred, DbgCtx), Ctx) :- |
| | 6961 | '$lgt_pp_category_'(Ctg, _, Dcl, Def, _, _), |
| | 6962 | '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), |
| | 6963 | '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx), |
| | 6964 | ( '$lgt_pp_extended_category_'(Ctg2, _, _, _, _), |
| | 6965 | ( '$lgt_pp_alias_'(Ctg2, Pred, Alias) -> |
| | 6966 | true |
| | 6967 | ; Pred = Alias |
| | 6968 | ), |
| | 6969 | '$lgt_ctg_static_binding_cache'(Ctg2, Pred, Sender, This, Self, TPred) -> |
| | 6970 | true |
| | 6971 | ; Pred = Alias, |
| | 6972 | TPred = '$lgt_call_pred_from_this'(category, Ctg, Dcl, Def, Pred, Sender, This, Self) |