Is there a meta_predicate tutorial?

From a theoretical point of view, there is a big difference, but from a practical point of view, not so much. You can print out closures to understand what’s going on – they’re just terms.

Note that you can put “module:” in front of a compound goal, e.g. some_module:(goal1(X), goal2(X,Y)).

Maybe your problem is in understanding how use_module/1 (and similar) modify the namespace in the current module?
TL;DR: all the imported names get added to the current module’s namespace. E.g., if you import foo:bar/1 into module qqsv (by :-use_module(foo,[bar/1])), then qqsv:bar(X) is the same as foo:bar(X) and if in module qqsv you don’t specify the module, qqsv is implicitly used – that is, bar(X) is the same as qqsv:bar(X) and for a call to a meta_predicate, qqsv: will be added if no module is explicitly given (for args specified by :, 0, etc.).

1 Like