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

Detailed Description

Data Structures

struct  reduct_eval_frame_t
 Evaluation frame structure. More...
 
struct  reduct_eval_state_t
 Evaluation state structure. More...
 

Macros

#define REDUCT_EVAL_REGS_INITIAL   64
 The initial amount of registers.
 
#define REDUCT_EVAL_REGS_GROWTH_FACTOR   2
 The growth factor of the registers array.
 
#define REDUCT_EVAL_FRAMES_INITIAL   32
 The initial size of the frames array.
 
#define REDUCT_EVAL_FRAMES_GROWTH_FACTOR   2
 The growth factor of the frames array.
 

Functions

REDUCT_API void reduct_eval_state_deinit (reduct_eval_state_t *state)
 Deinitialize an evaluation state structure.
 
REDUCT_API reduct_handle_t reduct_eval (reduct_t *reduct, reduct_function_t *function)
 Evaluates a compiled Reduct function.
 
REDUCT_API reduct_handle_t reduct_eval_file (reduct_t *reduct, const char *path)
 Parses, compiles and evaluates a file.
 
REDUCT_API reduct_handle_t reduct_eval_string (reduct_t *reduct, const char *str, reduct_size_t len)
 Parses, compiles and evaluates a string.
 
REDUCT_API reduct_handle_t reduct_eval_call (reduct_t *reduct, reduct_handle_t callable, reduct_size_t argc, reduct_handle_t *argv)
 Calls a Reduct callable (closure or native) with arguments.
 

Macro Definition Documentation

◆ REDUCT_EVAL_REGS_INITIAL

#define REDUCT_EVAL_REGS_INITIAL   64

The initial amount of registers.

Definition at line 18 of file eval.h.

◆ REDUCT_EVAL_REGS_GROWTH_FACTOR

#define REDUCT_EVAL_REGS_GROWTH_FACTOR   2

The growth factor of the registers array.

Definition at line 19 of file eval.h.

◆ REDUCT_EVAL_FRAMES_INITIAL

#define REDUCT_EVAL_FRAMES_INITIAL   32

The initial size of the frames array.

Definition at line 21 of file eval.h.

◆ REDUCT_EVAL_FRAMES_GROWTH_FACTOR

#define REDUCT_EVAL_FRAMES_GROWTH_FACTOR   2

The growth factor of the frames array.

Definition at line 22 of file eval.h.

Function Documentation

◆ reduct_eval_state_deinit()

REDUCT_API void reduct_eval_state_deinit ( reduct_eval_state_t state)

Deinitialize an evaluation state structure.

Parameters
stateThe evaluation state to deinitialize.

Definition at line 36 of file eval_impl.h.

Here is the caller graph for this function:

◆ reduct_eval()

REDUCT_API reduct_handle_t reduct_eval ( reduct_t reduct,
reduct_function_t function 
)

Evaluates a compiled Reduct function.

Parameters
reductThe Reduct instance.
functionThe function to evaluate.
Returns
The result of the evaluation as a Reduct handle.
Here is the caller graph for this function:

◆ reduct_eval_file()

REDUCT_API reduct_handle_t reduct_eval_file ( reduct_t reduct,
const char *  path 
)

Parses, compiles and evaluates a file.

Parameters
reductThe Reduct instance.
pathThe path to the file.
Returns
The result of the evaluation.

Definition at line 518 of file eval_impl.h.

Here is the call graph for this function:

◆ reduct_eval_string()

REDUCT_API reduct_handle_t reduct_eval_string ( reduct_t reduct,
const char *  str,
reduct_size_t  len 
)

Parses, compiles and evaluates a string.

Parameters
reductThe Reduct instance.
strThe string to evaluate.
lenThe length of the string.
Returns
The result of the evaluation.

Definition at line 528 of file eval_impl.h.

Here is the call graph for this function:

◆ reduct_eval_call()

REDUCT_API reduct_handle_t reduct_eval_call ( reduct_t reduct,
reduct_handle_t  callable,
reduct_size_t  argc,
reduct_handle_t argv 
)

Calls a Reduct callable (closure or native) with arguments.

Parameters
reductThe Reduct instance.
callableThe callable item handle.
argcThe number of arguments.
argvPointer to the arguments array.
Returns
The result of the call.

Definition at line 538 of file eval_impl.h.

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