]> Repositorios git - scryer-prolog.git/commitdiff
reorder declaration matching in loader.pl
authorMark Thom <[email protected]>
Tue, 23 Mar 2021 00:13:01 +0000 (18:13 -0600)
committerMark Thom <[email protected]>
Tue, 23 Mar 2021 00:13:01 +0000 (18:13 -0600)
src/loader.pl

index 3e2a7b9bbad1ab86cb4c911e2e46490eb9708f9a..89eac918ec535a7aa7a39132a69f6c606f6f42a8 100644 (file)
@@ -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),