I am writing a module A
which defines term_expansion/2
. As a side-effect, when it becomes imported by module B
, the terms defined in module B
will be expanded as described in module A
. However, I did not manage to also expand the terms which come from shell, after a user has loaded B
using ?- [B].
in an interactive session.
How do I manipulate the queries/directives which come from shell and call them instead?
Example:
If the user types
?- my_append("AB", "CD", L).
I want to expand the my_append
-term to something like this (but not restricted to it) which is then called after expansion:
?- extra_args(A0, A1), my_append_with_extra_args(A0, A1, "AB", "CD", L).
To be clear: The term-expansion/-manipulation itself is not the problem – what I need to know is the hook which can I use/redefine like term_expansion/2
.