From 9f861dfe89b8a3b2ef3c07b5291b94aee89d6d05 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Mon, 22 Mar 2021 18:13:01 -0600 Subject: [PATCH] reorder declaration matching in loader.pl --- src/loader.pl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/loader.pl b/src/loader.pl index 3e2a7b9b..89eac918 100644 --- a/src/loader.pl +++ b/src/loader.pl @@ -330,39 +330,39 @@ compile_declaration(module(Module, Exports), Evacuable) :- '$declare_module'(Module, Exports, Evacuable) ; type_error(atom, Module, load/1) ). -compile_declaration(dynamic(Name/Arity), Evacuable) :- - !, - must_be(atom, Name), - must_be(integer, Arity), - prolog_load_context(module, Module), - '$add_dynamic_predicate'(Module, Name, Arity, Evacuable). compile_declaration(dynamic(Module:Name/Arity), Evacuable) :- + !, must_be(atom, Module), must_be(atom, Name), must_be(integer, Arity), '$add_dynamic_predicate'(Module, Name, Arity, Evacuable). -compile_declaration(multifile(Name/Arity), Evacuable) :- - !, +compile_declaration(dynamic(Name/Arity), Evacuable) :- must_be(atom, Name), must_be(integer, Arity), prolog_load_context(module, Module), - '$add_multifile_predicate'(Module, Name, Arity, Evacuable). + '$add_dynamic_predicate'(Module, Name, Arity, Evacuable). compile_declaration(multifile(Module:Name/Arity), Evacuable) :- + !, must_be(atom, Module), must_be(atom, Name), must_be(integer, Arity), '$add_multifile_predicate'(Module, Name, Arity, Evacuable). -compile_declaration(discontiguous(Name/Arity), Evacuable) :- - !, +compile_declaration(multifile(Name/Arity), Evacuable) :- must_be(atom, Name), must_be(integer, Arity), prolog_load_context(module, Module), - '$add_discontiguous_predicate'(Module, Name, Arity, Evacuable). + '$add_multifile_predicate'(Module, Name, Arity, Evacuable). compile_declaration(discontiguous(Module:Name/Arity), Evacuable) :- + !, must_be(atom, Module), must_be(atom, Name), must_be(integer, Arity), '$add_discontiguous_predicate'(Module, Name, Arity, Evacuable). +compile_declaration(discontiguous(Name/Arity), Evacuable) :- + must_be(atom, Name), + must_be(integer, Arity), + prolog_load_context(module, Module), + '$add_discontiguous_predicate'(Module, Name, Arity, Evacuable). compile_declaration(initialization(Goal), Evacuable) :- prolog_load_context(module, Module), '$add_dynamic_predicate'(Module, '$initialization_goals', 1, Evacuable), -- 2.54.0