Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
Closure

Detailed Description

A closure is a function instance that has captured variables from its enclosing scope.

Data Structures

struct  reduct_closure_t
 Closure structure. More...
 

Macros

#define REDUCT_CLOSURE_SMALL_MAX   4
 The maximum number of small constants.
 

Functions

REDUCT_API void reduct_closure_deinit (reduct_closure_t *closure)
 Deinitialize a closure structure.
 
REDUCT_API reduct_closure_treduct_closure_new (struct reduct *reduct, reduct_function_t *function)
 Allocate a new closure.
 

Macro Definition Documentation

◆ REDUCT_CLOSURE_SMALL_MAX

#define REDUCT_CLOSURE_SMALL_MAX   4

The maximum number of small constants.

Definition at line 19 of file closure.h.

Function Documentation

◆ reduct_closure_deinit()

REDUCT_API void reduct_closure_deinit ( reduct_closure_t closure)

Deinitialize a closure structure.

Parameters
closureThe closure to deinitialize.

Definition at line 8 of file closure_impl.h.

Here is the caller graph for this function:

◆ reduct_closure_new()

REDUCT_API reduct_closure_t * reduct_closure_new ( struct reduct *  reduct,
reduct_function_t function 
)

Allocate a new closure.

Parameters
reductThe Reduct structure.
functionThe prototype function item.
Returns
A pointer to the newly allocated closure.

Definition at line 17 of file closure_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: