Used to test or enumerate currently set pragmas in the context module. This is typically only meaningful during the compilation process or during some other kind of source processing.
Source processing tools (or code invoked from source-processing tools, e.g. inline-transformations) can exploit the pragma facility to make their behaviour user-configurable. All they need to do is document the pragma names/structures and check for them using current_pragma/1.
:- pragma(blah). ?- findall(P, current_pragma(P), L), writeln(L). [blah] :- pragma(myoption(on)). ?- findall(P, current_pragma(P), L), writeln(L). [blah, myoption(on)] :- pragma(myoption(off)). ?- findall(P, current_pragma(P), L), writeln(L). [blah, myoption(off)] :- pragma(noblah). ?- findall(P, current_pragma(P), L), writeln(L). [myoption(off)] ?- current_pragma(myoption(off)). Yes.