giovinazzo-kevin / Ergo

Other
4 stars 0 forks source link

It should be possible to assert predicates in modules other than the current one #48

Closed giovinazzo-kevin closed 2 years ago

giovinazzo-kevin commented 2 years ago

This is required by #27.

For instance, the following code should be possible to define in any module, not just the user module:

user:message_hook(Term, Kind, Lines) :-
    format('Term: ~w~nKind: ~w~nLines: ~w~n~n',[Term,Kind,Lines]),
    print_message_lines(current_output,kind(Kind),Lines),
    nl.

The parser currently ignores this information and instead creates a predicate with head ':'(user, message_hook)(Term, Kind, Lines) in the current module

giovinazzo-kevin commented 2 years ago

This was already possible for dynamic predicates and the fix only required a two liner; no PR