From 176b07a7b56b9f8f105a949b70103f7f9e7fd27a Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 15 May 2025 17:40:58 -0500 Subject: [PATCH 1/3] Document module qualification --- src/lib/builtins.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index bea783f77..38bca9aca 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -33,6 +33,13 @@ internal settings and basic I/O are all here. */ +%% (:)(+M, +T) +% +% Module qualification. True if T succeeds when called in the context of module M. +% This calling context determines how predicates resolve to user-defined procedures. +% The context is flat. That is, in the goal `M2:M1:T`, predicate lookups are performed only in M1 and not M2. +% +% The calling context is visible to metaprocedures (declared with the meta_predicate directive). % unify. From 24d8b088ee73e03f9204043f3e10956434d79af4 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 15 May 2025 18:03:37 -0500 Subject: [PATCH 2/3] Fix spelling --- src/lib/builtins.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index 38bca9aca..b2419c212 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -33,7 +33,7 @@ internal settings and basic I/O are all here. */ -%% (:)(+M, +T) +%% :(+M, +T) % % Module qualification. True if T succeeds when called in the context of module M. % This calling context determines how predicates resolve to user-defined procedures. From 2cee55770d47774d692e48ef480bbfadbba2f798 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Wed, 18 Jun 2025 14:27:20 -0500 Subject: [PATCH 3/3] Recommend avoiding `:` --- src/lib/builtins.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index b2419c212..1be332503 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -35,11 +35,12 @@ %% :(+M, +T) % -% Module qualification. True if T succeeds when called in the context of module M. +% Explicit module qualification operator. True if T succeeds when called in the context of module M. % This calling context determines how predicates resolve to user-defined procedures. % The context is flat. That is, in the goal `M2:M1:T`, predicate lookups are performed only in M1 and not M2. % -% The calling context is visible to metaprocedures (declared with the meta_predicate directive). +% Consider carefully before using explicit module qualification. +% Prefer meta-predicate declarations when possible. % unify.