Add preliminary current_module/1 predicate definition requiring a bound argument
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
prolog_load_context/2,
|
||||
strip_module/3,
|
||||
use_module/1,
|
||||
use_module/2
|
||||
use_module/2,
|
||||
current_module/1
|
||||
]).
|
||||
|
||||
|
||||
@@ -465,6 +466,14 @@ use_module(Module, Exports) :-
|
||||
; use_module(Module, Exports, Evacuable)
|
||||
).
|
||||
|
||||
current_module(Module) :-
|
||||
( var(Module) ->
|
||||
instantiation_error(current_module/1)
|
||||
; \+ atom(Module) ->
|
||||
type_error(atom, Module, current_module/1)
|
||||
; '$module_exists'(Module)
|
||||
).
|
||||
|
||||
|
||||
%% If use_module is invoked in an existing load context, use its
|
||||
%% directory. Otherwise, use the relative path of Path.
|
||||
|
||||
Reference in New Issue
Block a user