Update aus Driversourcen
Change-Id: I8d7e34d98a37e2d376f25216f92873f48f76fabb
diff --git a/doc/LPC/operators b/doc/LPC/operators
index 911007b..24b3618 100644
--- a/doc/LPC/operators
+++ b/doc/LPC/operators
@@ -189,6 +189,12 @@
used as the file_name of an object, and calls
the function 'name' in this object.
+ expr1.name(...) The operator form of call_strict(). 'expr1'
+ gives either an object or a string which is
+ used as the file name of an object, and calls
+ the function 'name' in this object. Throws
+ an error, if the function does not exist.
+
ident::name(...)
Call the inherited function 'name' with the
given parameters in the parent 'ident'.
@@ -208,6 +214,7 @@
LDMud 3.2.9 added '>>>', '>>>=', '&&=' and '||='.
LDMud 3.2.10 extended '&' to mappings.
LDMud 3.3 extended '|' and '^' to arrays.
+ LDMud 3.6.2 added '.'.
SEE ALSO
arrays(LPC), alists(LPC), mappings(LPC), closures(LPC)
diff --git a/doc/LPC/structs b/doc/LPC/structs
index 0774e18..a53029a 100644
--- a/doc/LPC/structs
+++ b/doc/LPC/structs
@@ -113,10 +113,11 @@
in the same literal.
- A struct member is accessed using the -> operator:
+ A struct member is accessed using the . and -> operators:
struct Foo var = ...;
+ var.one = 1;
var->one = 1;
@@ -125,24 +126,14 @@
struct Foo bar = ...;
string member = "one";
+ bar.(member) = 1; // Sets bar.one to 1
+ bar.(0) = 1; // Sets bar.one to 1
bar->(member) = 1; // sets bar->one to 1
bar->(0) = 1; // sets bar->one to 1
- When using struct values held in variables/expressions of type
- 'mixed', the 'mixed' value should to be casted to the struct
- value. The cast can be omitted if the looked-up member exists
- in only one struct (and its children) known to the compiler:
-
- struct Foo { int one; };
- struct Bar { int two; };
- struct Baz { int two; };
- mixed var;
-
- var->one // looks up Foo->one
- (struct Foo)var->one // looks up Foo->one
- var->two // ERROR: ambiguous lookup
- (struct Bar)var->one // looks up Bar->one
+ If the given member does not exist, the -> operator will return 0,
+ but the . operator will throw an error.
USAGE IN CLOSURES
@@ -219,6 +210,8 @@
The implementation was revised in LDMud 3.3.344.
The reactivation of unchanged structs in object updates was
implemented in LDMud 3.3.417.
+ In LDMud 3.6.2 the . operator for struct member access was introduced
+ and the -> operator changed into a relaxed access operation.
SEE ALSO
diff --git a/doc/efun/call_strict b/doc/efun/call_strict
new file mode 100644
index 0000000..fbf6bd3
--- /dev/null
+++ b/doc/efun/call_strict
@@ -0,0 +1,50 @@
+SYNOPSIS
+ unknown call_strict(object|string ob, string func, ...)
+ unknown call_strict(object*|string* ob, string func, ...)
+
+ ob.fun(...)
+ ob->"fun"(...)
+ ob->(fun)(...)
+
+DESCRIPTION
+ Similar to call_other(). Call a member function <fun> in another
+ object <ob> if the function is defined and publicly accessible.
+ Any of the optional extra arguments are passed to the function.
+ Result is the value returned from the called function.
+
+ ob.fun(args) and ob."fun"(args) are equivalent to
+ call_strict(ob, "fun", args).
+ "ob_name".fun(args) and "ob_name"."fun"(args) are equivalent to
+ call_strict("ob_name", "fun", args);
+ ob.(fun)(args) is equivalent to call_strict(ob, fun, args),
+ "ob_name".(fun)(args) is equivalent to
+ call_strict("ob_name", fun, args).
+
+ If ob::fun does not define a publicly accessible function, the
+ efun will call the H_DEFAULT_METHOD hook if set. If the hook
+ is not set or can't resolve the call either, the efun will raise
+ a runtime error.
+
+ Calls to the master object never use the H_DEFAULT_METHOD hook.
+ To force non-default calls, the efun call_direct_strict() can
+ be used.
+
+ ob can also be an object_name. If a string is passed for ob
+ and an object with that name can't be found or loaded, an
+ error occurs.
+
+ Additionally the efun accepts an array of objects as <ob>: the
+ function is called with the same arguments in all the given objects.
+ The single results are collected in an array and yield the final
+ result. Array elements can be objects or the names of existing
+ objects. If a call to any of the objects failes, the efun will
+ raise a runtime error.
+
+HISTORY
+ Introduced in LDMud 3.6.2.
+
+SEE ALSO
+ call_other(E), call_resolved(E), call_direct(E),
+ call_direct_strict(E), call_direct_resolved(E),
+ create(A), pragma(LPC), extern_call(E), function_exists(E),
+ functions(LPC), map_objects(E)