You can import a predicate using a different name. You cannot import a module using a different name. You can load a module into a different module than the one declared in its header using load_files/2. What are you trying to do?
I have a bunch of stuff in a module called “coder_base” and I was getting fed up typing coder_base so I wondered if I could just :-use_module(long_name, [as(ln)]) … the as of course being wish fulfilment at this point.
PENNY! Thanks Jan… I think I might need meta-predicate thing again where it knows to bind the module name to the call argument…except its not really an operator or did I misunderstand meta predicates !!!
The module system is designed (by Quintus in the late 80s) such that it is an exception that you need to type or even know the module name. That still makes me wonder what you are trying to achieve
Yes, but the predicate I am calling is returning a “promise” to be executed later.
It returns, in the spirit of print_message/2 a list of pairs of format strings and arguments, for example:
if_then(..., Out ) :-
...
Out = ['if (~s) {\n'-[CondStr],
indent(IfBodyStr), nl, '}',
% this line added to demonstrate my problem
'~@'-[ coder_base:csv(ListOfThings)]
]
The problem is that I have to qualify the call to coder_base:csv because when this code executes I am no longer in this module but in my “render” module…so it’s like the meta predicate thing where you can tell the compiler to maintain the module name as part of the call site information.