1.1 --- a/docs/syspython.txt Fri Nov 29 01:37:15 2013 +0100
1.2 +++ b/docs/syspython.txt Fri Nov 29 01:38:25 2013 +0100
1.3 @@ -23,14 +23,32 @@
1.4 or method. Note that the apply function resembles the Python function of the
1.5 same name but is not actually that particular function.
1.6
1.7 + apply(fn, ...) # general invocation
1.8 +
1.9 A family of special functions for invocations exists, addressing optimisation
1.10 situations identified by program analysis:
1.11
1.12 - apply # general invocation
1.13 - applyclass # direct invocation of an instantiator
1.14 - applyfunction # function-specific invocation
1.15 - applystaticmethod # specific invocation of a method via a class
1.16 - applymethod # specific invocation of a method via self
1.17 + applyclass(cls, ...) # direct invocation of an instantiator
1.18 + applyfunction(fn, ...) # function-specific invocation
1.19 + applystaticmethod(fn, obj, ...) # specific invocation of a method via a class
1.20 + applymethod(fn, obj, ...) # specific invocation of a method via self
1.21 +
1.22 +Where dynamic functions are to be invoked, the context providing the defaults
1.23 +needs to be supplied to the function or method, but this can be done using the
1.24 +above special functions as follows:
1.25 +
1.26 + applyclass(cls, __context__, ...)
1.27 + applyfunction(fn, __context__, ...)
1.28 + applystaticmethod(fn, __context__, obj, ...)
1.29 + applymethod(fn, __context__, obj, ...)
1.30 +
1.31 +Where optimisation possibilities cannot be identified in advance, the apply
1.32 +function must deal with the following aspects of invocation:
1.33 +
1.34 + * Whether a context argument is required
1.35 + * Whether a dynamic function is being invoked, thus requiring a context for
1.36 + access to defaults
1.37 + * Whether an appropriate number of arguments have been provided
1.38
1.39 Low-Level Code
1.40 --------------