|
Reduct
v4.0.5-1-g4851deb
A functional and immutable language.
|
Data Structures | |
| struct | reduct_eval_frame_t |
| Evaluation frame structure. More... | |
| struct | reduct_eval_local_t |
| Per-thread eval-related 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_local_init (reduct_eval_local_t *local) |
| Initialize a local eval state. | |
| REDUCT_API void | reduct_eval_local_deinit (reduct_eval_local_t *local) |
| Deinitialize a local eval state. | |
| REDUCT_API reduct_handle_t | reduct_eval (struct reduct *reduct, reduct_handle_t handle) |
| Evaluates a handle. | |
| REDUCT_API reduct_handle_t | reduct_eval_file (struct reduct *reduct, const char *path, reduct_optimize_flags_t optimize) |
| Parses, builds, optimizes, emits and evaluates a file. | |
| REDUCT_API reduct_handle_t | reduct_eval_string (struct reduct *reduct, const char *str, size_t len, reduct_optimize_flags_t optimize) |
| Parses, builds, optimizes, emits and evaluates a string. | |
| REDUCT_API reduct_handle_t | reduct_eval_call (struct reduct *reduct, reduct_handle_t callable, size_t argc, reduct_handle_t *argv) |
| Calls a Reduct callable (closure or native) with arguments. | |
| REDUCT_API reduct_handle_t | reduct_eval_call_v (struct reduct *reduct, reduct_handle_t callable, size_t argc,...) |
| Calls a Reduct callable (closure or native) with variadic arguments. | |
| #define REDUCT_EVAL_REGS_INITIAL 64 |
| #define REDUCT_EVAL_REGS_GROWTH_FACTOR 2 |
| #define REDUCT_EVAL_FRAMES_INITIAL 32 |
| #define REDUCT_EVAL_FRAMES_GROWTH_FACTOR 2 |
| REDUCT_API void reduct_eval_local_init | ( | reduct_eval_local_t * | local | ) |
Initialize a local eval state.
| local | Pointer to the local eval state to initialize. |
| REDUCT_API void reduct_eval_local_deinit | ( | reduct_eval_local_t * | local | ) |
Deinitialize a local eval state.
| local | Pointer to the local eval state to deinitialize. |
| REDUCT_API reduct_handle_t reduct_eval | ( | struct reduct * | reduct, |
| reduct_handle_t | handle | ||
| ) |
Evaluates a handle.
If the handle is a compiled function then it will be interpreted, otherwise, it will first be compiled into a function.
| reduct | The Reduct instance. |
| handle | The handle to evaluate. |
| REDUCT_API reduct_handle_t reduct_eval_file | ( | struct reduct * | reduct, |
| const char * | path, | ||
| reduct_optimize_flags_t | optimize | ||
| ) |
Parses, builds, optimizes, emits and evaluates a file.
| reduct | The Reduct instance. |
| path | The path to the file. |
| flags | Optimization flags to control which optimizations are applied. |
| REDUCT_API reduct_handle_t reduct_eval_string | ( | struct reduct * | reduct, |
| const char * | str, | ||
| size_t | len, | ||
| reduct_optimize_flags_t | optimize | ||
| ) |
Parses, builds, optimizes, emits and evaluates a string.
| reduct | The Reduct instance. |
| str | The string to evaluate. |
| len | The length of the string. |
| flags | Optimization flags to control which optimizations are applied. |
| REDUCT_API reduct_handle_t reduct_eval_call | ( | struct reduct * | reduct, |
| reduct_handle_t | callable, | ||
| size_t | argc, | ||
| reduct_handle_t * | argv | ||
| ) |
Calls a Reduct callable (closure or native) with arguments.
| reduct | The Reduct instance. |
| callable | The callable item handle. |
| argc | The number of arguments. |
| argv | Pointer to the arguments array. |
| REDUCT_API reduct_handle_t reduct_eval_call_v | ( | struct reduct * | reduct, |
| reduct_handle_t | callable, | ||
| size_t | argc, | ||
| ... | |||
| ) |
Calls a Reduct callable (closure or native) with variadic arguments.
| reduct | The Reduct instance. |
| callable | The callable item handle. |
| argc | The number of arguments. |
| ... | The arguments (as reduct_handle_t). |