|
Reduct
v1.0.4-3-gdaf0d70
A functional and immutable language.
|
A intrinsic is an atom recognized by the bytecode compiler as a special form or built-in operator, resulting in it emitting specific bytecode instructions for each intrinsic.
This is in contrast to a "native" which will be invoked as a standard function call at runtime.
Macros | |
| #define | REDUCT_INTRINSIC_NONE 0 |
| None. | |
| #define | REDUCT_INTRINSIC_QUOTE 1 |
| Quote. | |
| #define | REDUCT_INTRINSIC_LIST 2 |
| List. | |
| #define | REDUCT_INTRINSIC_DO 3 |
| Do. | |
| #define | REDUCT_INTRINSIC_LAMBDA 4 |
| Lambda. | |
| #define | REDUCT_INTRINSIC_THREAD 5 |
| Thread. | |
| #define | REDUCT_INTRINSIC_DEF 6 |
| Def. | |
| #define | REDUCT_INTRINSIC_IF 7 |
| If. | |
| #define | REDUCT_INTRINSIC_COND 8 |
| Cond. | |
| #define | REDUCT_INTRINSIC_MATCH 9 |
| Match. | |
| #define | REDUCT_INTRINSIC_AND 10 |
| And. | |
| #define | REDUCT_INTRINSIC_OR 11 |
| Or. | |
| #define | REDUCT_INTRINSIC_NOT 12 |
| Not. | |
| #define | REDUCT_INTRINSIC_ADD 13 |
| Add. | |
| #define | REDUCT_INTRINSIC_SUB 14 |
| Sub. | |
| #define | REDUCT_INTRINSIC_MUL 15 |
| Mul. | |
| #define | REDUCT_INTRINSIC_DIV 16 |
| Div. | |
| #define | REDUCT_INTRINSIC_MOD 17 |
| Mod. | |
| #define | REDUCT_INTRINSIC_INC 18 |
| Inc. | |
| #define | REDUCT_INTRINSIC_DEC 19 |
| Dec. | |
| #define | REDUCT_INTRINSIC_BAND 20 |
| Bitwise And. | |
| #define | REDUCT_INTRINSIC_BOR 21 |
| Bitwise Or. | |
| #define | REDUCT_INTRINSIC_BXOR 22 |
| Bitwise Xor. | |
| #define | REDUCT_INTRINSIC_BNOT 23 |
| Bitwise Not. | |
| #define | REDUCT_INTRINSIC_SHL 24 |
| Bitwise Shift Left. | |
| #define | REDUCT_INTRINSIC_SHR 25 |
| Bitwise Shift Right. | |
| #define | REDUCT_INTRINSIC_EQ 26 |
| Equal. | |
| #define | REDUCT_INTRINSIC_NEQ 27 |
| Not Equal. | |
| #define | REDUCT_INTRINSIC_SEQ 28 |
| Strict Equal. | |
| #define | REDUCT_INTRINSIC_SNEQ 29 |
| Strict Not Equal. | |
| #define | REDUCT_INTRINSIC_LT 30 |
| Less. | |
| #define | REDUCT_INTRINSIC_LE 31 |
| Less Equal. | |
| #define | REDUCT_INTRINSIC_GT 32 |
| Greater. | |
| #define | REDUCT_INTRINSIC_GE 33 |
| Greater Equal. | |
| #define | REDUCT_INTRINSIC_MAX 34 |
| The amount of intrinsics. | |
Typedefs | |
| typedef reduct_uint8_t | reduct_intrinsic_t |
| Intrinsic types. | |
| typedef void(* | reduct_intrinsic_handler_t) (struct reduct_compiler *compiler, struct reduct_item *expr, struct reduct_expr *out) |
| Intrinsic handler function type. | |
Functions | |
| REDUCT_API void | reduct_intrinsic_register_all (struct reduct *reduct) |
| Registers all Reduct intrinsics with the given Reduct instance. | |
| void | reduct_intrinsic_block_generic (struct reduct_compiler *compiler, struct reduct_item *list, reduct_uint32_t startIdx, struct reduct_expr *out) |
Compiles a block of expressions (like a do block). | |
Variables | |
| reduct_intrinsic_handler_t | reductIntrinsicHandlers [REDUCT_INTRINSIC_MAX] |
| Intrinsic handler functions array. | |
| reduct_native_fn | reductIntrinsicNatives [REDUCT_INTRINSIC_MAX] |
| Intrinsic native functions array. | |
| const char * | reductIntrinsics [REDUCT_INTRINSIC_MAX] |
| Intrinsic names array. | |
| #define REDUCT_INTRINSIC_NONE 0 |
None.
Definition at line 30 of file intrinsic.h.
| #define REDUCT_INTRINSIC_QUOTE 1 |
Quote.
Definition at line 31 of file intrinsic.h.
| #define REDUCT_INTRINSIC_LIST 2 |
List.
Definition at line 32 of file intrinsic.h.
| #define REDUCT_INTRINSIC_DO 3 |
Do.
Definition at line 33 of file intrinsic.h.
| #define REDUCT_INTRINSIC_LAMBDA 4 |
Lambda.
Definition at line 34 of file intrinsic.h.
| #define REDUCT_INTRINSIC_THREAD 5 |
Thread.
Definition at line 35 of file intrinsic.h.
| #define REDUCT_INTRINSIC_DEF 6 |
Def.
Definition at line 36 of file intrinsic.h.
| #define REDUCT_INTRINSIC_IF 7 |
If.
Definition at line 37 of file intrinsic.h.
| #define REDUCT_INTRINSIC_COND 8 |
Cond.
Definition at line 38 of file intrinsic.h.
| #define REDUCT_INTRINSIC_MATCH 9 |
Match.
Definition at line 39 of file intrinsic.h.
| #define REDUCT_INTRINSIC_AND 10 |
And.
Definition at line 40 of file intrinsic.h.
| #define REDUCT_INTRINSIC_OR 11 |
Or.
Definition at line 41 of file intrinsic.h.
| #define REDUCT_INTRINSIC_NOT 12 |
Not.
Definition at line 42 of file intrinsic.h.
| #define REDUCT_INTRINSIC_ADD 13 |
Add.
Definition at line 43 of file intrinsic.h.
| #define REDUCT_INTRINSIC_SUB 14 |
Sub.
Definition at line 44 of file intrinsic.h.
| #define REDUCT_INTRINSIC_MUL 15 |
Mul.
Definition at line 45 of file intrinsic.h.
| #define REDUCT_INTRINSIC_DIV 16 |
Div.
Definition at line 46 of file intrinsic.h.
| #define REDUCT_INTRINSIC_MOD 17 |
Mod.
Definition at line 47 of file intrinsic.h.
| #define REDUCT_INTRINSIC_INC 18 |
Inc.
Definition at line 48 of file intrinsic.h.
| #define REDUCT_INTRINSIC_DEC 19 |
Dec.
Definition at line 49 of file intrinsic.h.
| #define REDUCT_INTRINSIC_BAND 20 |
Bitwise And.
Definition at line 50 of file intrinsic.h.
| #define REDUCT_INTRINSIC_BOR 21 |
Bitwise Or.
Definition at line 51 of file intrinsic.h.
| #define REDUCT_INTRINSIC_BXOR 22 |
Bitwise Xor.
Definition at line 52 of file intrinsic.h.
| #define REDUCT_INTRINSIC_BNOT 23 |
Bitwise Not.
Definition at line 53 of file intrinsic.h.
| #define REDUCT_INTRINSIC_SHL 24 |
Bitwise Shift Left.
Definition at line 54 of file intrinsic.h.
| #define REDUCT_INTRINSIC_SHR 25 |
Bitwise Shift Right.
Definition at line 55 of file intrinsic.h.
| #define REDUCT_INTRINSIC_EQ 26 |
Equal.
Definition at line 56 of file intrinsic.h.
| #define REDUCT_INTRINSIC_NEQ 27 |
Not Equal.
Definition at line 57 of file intrinsic.h.
| #define REDUCT_INTRINSIC_SEQ 28 |
Strict Equal.
Definition at line 58 of file intrinsic.h.
| #define REDUCT_INTRINSIC_SNEQ 29 |
Strict Not Equal.
Definition at line 59 of file intrinsic.h.
| #define REDUCT_INTRINSIC_LT 30 |
Less.
Definition at line 60 of file intrinsic.h.
| #define REDUCT_INTRINSIC_LE 31 |
Less Equal.
Definition at line 61 of file intrinsic.h.
| #define REDUCT_INTRINSIC_GT 32 |
Greater.
Definition at line 62 of file intrinsic.h.
| #define REDUCT_INTRINSIC_GE 33 |
Greater Equal.
Definition at line 63 of file intrinsic.h.
| #define REDUCT_INTRINSIC_MAX 34 |
The amount of intrinsics.
Definition at line 64 of file intrinsic.h.
| typedef reduct_uint8_t reduct_intrinsic_t |
Intrinsic types.
Definition at line 28 of file intrinsic.h.
| typedef void( * reduct_intrinsic_handler_t) (struct reduct_compiler *compiler, struct reduct_item *expr, struct reduct_expr *out) |
Intrinsic handler function type.
Definition at line 69 of file intrinsic.h.
| REDUCT_API void reduct_intrinsic_register_all | ( | struct reduct * | reduct | ) |
Registers all Reduct intrinsics with the given Reduct instance.
| reduct | The Reduct instance to register intrinsics with. |
| void reduct_intrinsic_block_generic | ( | struct reduct_compiler * | compiler, |
| struct reduct_item * | list, | ||
| reduct_uint32_t | startIdx, | ||
| struct reduct_expr * | out | ||
| ) |
Compiles a block of expressions (like a do block).
| compiler | The compiler context. |
| list | The list containing the expressions. |
| startIdx | The index to start compiling from. |
| out | The output expression. |
|
extern |
Intrinsic handler functions array.
Definition at line 1201 of file intrinsic_impl.h.
|
extern |
Intrinsic native functions array.
Definition at line 1484 of file intrinsic_impl.h.
|
extern |
Intrinsic names array.
Definition at line 1243 of file intrinsic_impl.h.