Closures for CFMX

PDF HTML FlashPaper

ClosureFactory

The Closure Factory Object

The ClosureFactory component creates closure objects. Normally you would create a singleton of the factory (e.g., place it in application scope).

The only public method in the factory is:

Closure new(block[,args])

The block parameter can specify a string containing ColdFusion code or it can specify a user-defined function or method.

The optional args parameter can specify a comma-delimited list of argument names for the generated closure.

new() returns a ClosureObject that, by default has a call() method which you use to invoke the closure.