From 9d1203d2ad5904529754e5e889fe37f8d229ad4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 14 Sep 2012 12:25:13 +0200 Subject: global: Allow "tuple funs" as resolve functions Commit de7e01c958ff7c9e6da4034a53567a30a4ae5792 removed support for tuple funs. To still allow resolve functions for global:{re_}register_name/3 to be specified as {M,F}, we'll need to translate {M,F} to an external fun. Also update the documentation to mention that the use of {M,F} to specify a resolve function is deprecated, and to add a recommendation to use an external fun. --- lib/kernel/doc/src/global.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/global.xml b/lib/kernel/doc/src/global.xml index 304a9b1d88..9c50049503 100644 --- a/lib/kernel/doc/src/global.xml +++ b/lib/kernel/doc/src/global.xml @@ -163,7 +163,8 @@ Globally register a name for a pid {Module, Function} - is also allowed + is currently also allowed for backward compatibility, but its use is + deprecated

Globally associates the name Name with a pid, that is, @@ -180,6 +181,15 @@ unregistered. This function is called once for each name clash.

+ +

If you plan to change code without restarting your system, + you must use an external fun (fun Module:Function/Arity) + as the Resolve function; if you use a + local fun you can never replace the code for the module that + the fun belongs to. +

+
+

There are three pre-defined resolve functions: random_exit_name/3, random_notify_name/3, and notify_all_name/3. If no Resolve function is -- cgit v1.2.3