File: repl.txt

package info (click to toggle)
node-stdlib 0.0.96%2Bds1%2B~cs0.0.429-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 421,476 kB
  • sloc: javascript: 1,562,831; ansic: 109,702; lisp: 49,823; cpp: 27,224; python: 7,871; sh: 6,807; makefile: 6,089; fortran: 3,102; awk: 387
file content (43 lines) | stat: -rw-r--r-- 968 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

{{alias}}( ...f )
    Function composition.

    Returns a composite function. Starting from the right, the composite
    function evaluates each function and passes the result as an argument
    to the next function. The result of the leftmost function is the result
    of the whole.

    Notes:

    - Only the rightmost function is explicitly permitted to accept multiple
      arguments. All other functions are evaluated as unary functions.
    - The function will throw if provided fewer than two input arguments.

    Parameters
    ----------
    f: ...Function
        Functions to compose.

    Returns
    -------
    out: Function
        Composite function.

    Examples
    --------
    > function a( x ) {
    ...    return 2 * x;
    ... }
    > function b( x ) {
    ...    return x + 3;
    ... }
    > function c( x ) {
    ...    return x / 5;
    ... }
    > var f = {{alias}}( c, b, a );
    > var z = f( 6 )
    3

    See Also
    --------