Variable function (function value) context

Function Type - (definitions) -> function variables - (Context Assignment) -> function constructing -> value function -> evaluation.

 

First, the function type

typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);

public typealias Listener = (NetworkReachabilityStatus) -> Void

int (* p) (int, int)

 

Second, the function variables

As a member of the (function) variables and parameters (function) variable

@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock;

static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block)

open was listenership: Listener?

 

And local variables incomplete function.

 

Third, the function assignment

 

Fourth, the context assignment

1, currying;

2, partial function;

3, call the assignment;

4, internal function, and the context of the closure;

 

Fifth, what partial functions, curried, internal function is

Stored in the local context initialization (function) of the value of the function (function variables). Value function.

Initializing a stored value in the context of the function (function) of.

Context (function) is only a function assigned context variables were calculated.

 

Performing a context-dependent value of the function (function) call.

func pipeLineGo(en:[(String) -> String ])->(String)->String{

    func innerFunc(px:String)->String{

        return en.reduce(px, { (px, fn) -> String in

            return fn(px);

        })

    }

    

    Return innerFunc;

}

 

Sixth, incomplete function and Construction

Internal reference functions in the context of environment variables.

Assignment process context variables to build process incomplete function.

 

Guess you like

Origin www.cnblogs.com/feng9exe/p/11389292.html