Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
standard_impl.h File Reference
#include "char.h"
#include "compile.h"
#include "core.h"
#include "defs.h"
#include "eval.h"
#include "gc.h"
#include "handle.h"
#include "item.h"
#include "native.h"
#include "parse.h"
#include "standard.h"
#include "stringify.h"
Include dependency graph for standard_impl.h:

Go to the source code of this file.

Macros

#define REDUCT_ANY_ALL_IMPL(_name, _predicate, _default)
 
#define REDUCT_INTROSPECTION_LOOP(_predicate)
 
#define REDUCT_INTROSPECTION_IMPL(_name, _predicate_macro)
 
#define REDUCT_PREDICATE_IS_STRING(_h)   (REDUCT_HANDLE_IS_ATOM(_h) && !REDUCT_HANDLE_IS_NUMBER_SHAPED(_h))
 
#define REDUCT_PREDICATE_IS_EMPTY(_h)   (reduct_handle_item(reduct, _h)->length == 0)
 
#define REDUCT_PREDICATE_IS_NIL(_h)   (*(_h) == reduct_handle_nil(reduct))
 
#define REDUCT_GET_NUMERIC_IMPL(_name, _res, _type, _other, _targetUnion, _otherUnion)
 
#define REDUCT_MATH_MIN_MAX_IMPL(_name, _op)
 
#define REDUCT_MATH_UNARY_IMPL(_name, _int_func, _float_func)
 
#define REDUCT_INT_ABS(_x)   ((_x) < 0 ? -(_x) : (_x))
 
#define REDUCT_MATH_UNARY_TO_INT_IMPL(_name, _float_func)
 
#define REDUCT_MATH_UNARY_FLOAT_IMPL(_name, _func)
 
#define REDUCT_STDLIB_WRAPPER_0(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_1(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_2(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_3(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_R12(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_R23(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_R34(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_ARG2(_name, _impl)
 
#define REDUCT_STDLIB_WRAPPER_V1(_name, _impl)
 

Functions

REDUCT_API reduct_handle_t reduct_assert (reduct_t *reduct, reduct_handle_t *cond, reduct_handle_t *msg)
 
REDUCT_API reduct_handle_t reduct_throw (reduct_t *reduct, reduct_handle_t *msg)
 
REDUCT_API reduct_handle_t reduct_try (reduct_t *reduct, reduct_handle_t *callable, reduct_handle_t *catchFn)
 
REDUCT_API reduct_handle_t reduct_map (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *callable)
 
REDUCT_API reduct_handle_t reduct_filter (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *callable)
 
REDUCT_API reduct_handle_t reduct_reduce (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *initial, reduct_handle_t *callable)
 
REDUCT_API reduct_handle_t reduct_apply (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *callable)
 
static reduct_handle_t reduct_eval_maybe_call (reduct_t *reduct, reduct_handle_t fn, reduct_handle_t *arg)
 
static void reduct_sort_merge (reduct_t *reduct, reduct_handle_t callable, reduct_handle_t *a, reduct_size_t left, reduct_size_t right, reduct_size_t end, reduct_handle_t *b)
 
REDUCT_API reduct_handle_t reduct_sort (reduct_t *reduct, reduct_handle_t *listHandle, reduct_handle_t *callableHandle)
 
static reduct_int64_t reduct_handle_normalize_index (reduct_t *reduct, reduct_handle_t *index, reduct_size_t length)
 
static void reduct_sequence_normalize_range (reduct_t *reduct, reduct_handle_t *startH, reduct_handle_t *endH, reduct_size_t length, reduct_size_t *outStart, reduct_size_t *outEnd)
 
static reduct_handle_t reduct_list_find_entry (reduct_t *reduct, reduct_item_t *listItem, reduct_handle_t *key)
 
static reduct_bool_t reduct_list_get_entry (reduct_t *reduct, reduct_handle_t *entryH, reduct_handle_t *outKey, reduct_handle_t *outVal)
 
REDUCT_API reduct_handle_t reduct_len (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_range (struct reduct *reduct, reduct_handle_t *start, reduct_handle_t *end, reduct_handle_t *step)
 
REDUCT_API reduct_handle_t reduct_concat (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_sequence_edge (reduct_t *reduct, reduct_handle_t *handle, reduct_bool_t first)
 
REDUCT_API reduct_handle_t reduct_first (reduct_t *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_last (reduct_t *reduct, reduct_handle_t *handle)
 
static reduct_handle_t reduct_sequence_trim (reduct_t *reduct, reduct_handle_t *handle, reduct_bool_t rest)
 
REDUCT_API reduct_handle_t reduct_rest (reduct_t *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_init (reduct_t *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_nth (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *index, reduct_handle_t *defaultVal)
 
static char reduct_handle_get_char (reduct_t *reduct, reduct_handle_t *handle, char defaultChar)
 
REDUCT_API reduct_handle_t reduct_assoc (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *index, reduct_handle_t *value, reduct_handle_t *fillVal)
 
REDUCT_API reduct_handle_t reduct_dissoc (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *index)
 
REDUCT_API reduct_handle_t reduct_update (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *index, reduct_handle_t *callable, reduct_handle_t *fillVal)
 
REDUCT_API reduct_handle_t reduct_index_of (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *target)
 
REDUCT_API reduct_handle_t reduct_reverse (reduct_t *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_slice (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *startH, reduct_handle_t *endH)
 
REDUCT_API reduct_handle_t reduct_flatten (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *depthH)
 
REDUCT_API reduct_handle_t reduct_contains (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *target)
 
REDUCT_API reduct_handle_t reduct_replace (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *oldVal, reduct_handle_t *newVal)
 
REDUCT_API reduct_handle_t reduct_unique (struct reduct *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_chunk (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *sizeH)
 
REDUCT_API reduct_handle_t reduct_find (struct reduct *reduct, reduct_handle_t *handle, reduct_handle_t *callable)
 
REDUCT_API reduct_handle_t reduct_get_in (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *path, reduct_handle_t *defaultVal)
 
REDUCT_API reduct_handle_t reduct_assoc_in (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *path, reduct_handle_t *val)
 
REDUCT_API reduct_handle_t reduct_dissoc_in (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *path)
 
REDUCT_API reduct_handle_t reduct_update_in (reduct_t *reduct, reduct_handle_t *list, reduct_handle_t *path, reduct_handle_t *callable)
 
static reduct_handle_t reduct_list_project (reduct_t *reduct, reduct_handle_t *listHandle, reduct_size_t index, const char *name)
 
REDUCT_API reduct_handle_t reduct_keys (reduct_t *reduct, reduct_handle_t *listHandle)
 
REDUCT_API reduct_handle_t reduct_values (reduct_t *reduct, reduct_handle_t *listHandle)
 
REDUCT_API reduct_handle_t reduct_merge (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_explode (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_implode (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_repeat (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *count)
 
static reduct_handle_t reduct_sequence_check_edge (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *target, reduct_bool_t start, const char *name)
 
REDUCT_API reduct_handle_t reduct_starts_with (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *prefix)
 
REDUCT_API reduct_handle_t reduct_ends_with (reduct_t *reduct, reduct_handle_t *handle, reduct_handle_t *suffix)
 
REDUCT_API reduct_handle_t reduct_join (reduct_t *reduct, reduct_handle_t *listHandle, reduct_handle_t *sepHandle)
 
REDUCT_API reduct_handle_t reduct_split (reduct_t *reduct, reduct_handle_t *srcHandle, reduct_handle_t *sepHandle)
 
static reduct_handle_t reduct_string_transform (reduct_t *reduct, reduct_handle_t *srcHandle, reduct_bool_t upper)
 
REDUCT_API reduct_handle_t reduct_upper (reduct_t *reduct, reduct_handle_t *srcHandle)
 
REDUCT_API reduct_handle_t reduct_lower (reduct_t *reduct, reduct_handle_t *srcHandle)
 
REDUCT_API reduct_handle_t reduct_trim (reduct_t *reduct, reduct_handle_t *srcHandle)
 
REDUCT_API reduct_handle_t reduct_get_string (reduct_t *reduct, reduct_handle_t *handle)
 
static void reduct_path_copy (reduct_t *reduct, char *dest, const char *src, reduct_size_t len, reduct_size_t max)
 
static void reduct_resolve_path (reduct_t *reduct, const char *path, reduct_size_t pathLen, char *outPath, reduct_size_t maxLen)
 
REDUCT_API reduct_handle_t reduct_run (struct reduct *reduct, reduct_handle_t *handle)
 
static void reduct_get_resolved_path (reduct_t *reduct, reduct_handle_t *pathHandle, char *outBuf)
 
REDUCT_API reduct_handle_t reduct_load (struct reduct *reduct, reduct_handle_t *path)
 
REDUCT_API reduct_handle_t reduct_read_file (struct reduct *reduct, reduct_handle_t *path)
 
REDUCT_API reduct_handle_t reduct_write_file (struct reduct *reduct, reduct_handle_t *path, reduct_handle_t *content)
 
REDUCT_API reduct_handle_t reduct_read_char (struct reduct *reduct)
 
REDUCT_API reduct_handle_t reduct_read_line (struct reduct *reduct)
 
REDUCT_API reduct_handle_t reduct_print (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_println (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_ord (struct reduct *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_chr (struct reduct *reduct, reduct_handle_t *handle)
 
REDUCT_API reduct_handle_t reduct_format (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API reduct_handle_t reduct_now (reduct_t *reduct)
 
REDUCT_API reduct_handle_t reduct_uptime (reduct_t *reduct)
 
REDUCT_API reduct_handle_t reduct_env (struct reduct *reduct)
 
REDUCT_API reduct_handle_t reduct_args (struct reduct *reduct)
 
REDUCT_API reduct_handle_t reduct_clamp (reduct_t *reduct, reduct_handle_t *val, reduct_handle_t *minVal, reduct_handle_t *maxVal)
 
REDUCT_API reduct_handle_t reduct_pow (reduct_t *reduct, reduct_handle_t *base, reduct_handle_t *exp)
 
REDUCT_API reduct_handle_t reduct_log (struct reduct *reduct, reduct_handle_t *val, reduct_handle_t *base)
 
REDUCT_API reduct_handle_t reduct_atan2 (struct reduct *reduct, reduct_handle_t *y, reduct_handle_t *x)
 
REDUCT_API reduct_handle_t reduct_rand (struct reduct *reduct, reduct_handle_t *minVal, reduct_handle_t *maxVal)
 
REDUCT_API reduct_handle_t reduct_seed (struct reduct *reduct, reduct_handle_t *val)
 
static reduct_handle_t reduct_stdlib_reduce (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_range (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_concat (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_repeat (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_eval_impl (reduct_t *reduct, reduct_handle_t *arg)
 
static reduct_handle_t reduct_stdlib_parse_impl (reduct_t *reduct, reduct_handle_t *arg)
 
static reduct_handle_t reduct_stdlib_print (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_println (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
static reduct_handle_t reduct_stdlib_format (reduct_t *reduct, reduct_size_t argc, reduct_handle_t *argv)
 
REDUCT_API void reduct_stdlib_register (reduct_t *reduct, reduct_stdlib_sets_t sets)
 

Macro Definition Documentation

◆ REDUCT_ANY_ALL_IMPL

#define REDUCT_ANY_ALL_IMPL (   _name,
  _predicate,
  _default 
)
Value:
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
REDUCT_ERROR_CHECK_LIST(reduct, list, #_name); \
reduct_item_t* listItem = REDUCT_HANDLE_TO_ITEM(list); \
reduct_handle_t fn = (callable != REDUCT_NULL) ? *callable : REDUCT_HANDLE_NONE; \
reduct_handle_t entry; \
REDUCT_LIST_FOR_EACH(&entry, &listItem->list) \
{ \
reduct_handle_t result = reduct_eval_maybe_call(reduct, fn, &entry); \
REDUCT_GC_RETAIN(reduct, result); \
if (_predicate) \
{ \
REDUCT_GC_RELEASE(reduct, result); \
return REDUCT_HANDLE_FROM_INT(!(_default)); \
} \
REDUCT_GC_RELEASE(reduct, result); \
} \
return REDUCT_HANDLE_FROM_INT(_default); \
}
reduct_uint64_t reduct_handle_t
Handle type.
Definition defs.h:189
#define REDUCT_API
Definition defs.h:7
#define REDUCT_NULL
Definition defs.h:23
#define REDUCT_HANDLE_TO_ITEM(_handle)
Get the item pointer of a handle.
Definition handle.h:257
#define REDUCT_HANDLE_FROM_INT(_val)
Create a handle from an integer.
Definition handle.h:54
#define REDUCT_HANDLE_NONE
Invalid handle constant.
Definition handle.h:36
static reduct_handle_t reduct_eval_maybe_call(reduct_t *reduct, reduct_handle_t fn, reduct_handle_t *arg)
Item structure.
Definition item.h:57
reduct_list_t list
A list.
Definition item.h:67
State structure.
Definition core.h:61

Definition at line 205 of file standard_impl.h.

◆ REDUCT_INTROSPECTION_LOOP

#define REDUCT_INTROSPECTION_LOOP (   _predicate)
Value:
do \
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
REDUCT_ASSERT(argv != REDUCT_NULL || argc == 0); \
for (reduct_size_t i = 0; i < argc; i++) \
{ \
if (!(_predicate)) \
{ \
return REDUCT_HANDLE_FALSE(); \
} \
} \
return REDUCT_HANDLE_TRUE(); \
} while (0)
size_t reduct_size_t
Definition defs.h:100
#define REDUCT_HANDLE_FALSE()
Constant false handle.
Definition handle.h:267
#define REDUCT_HANDLE_TRUE()
Constant true handle.
Definition handle.h:269

Definition at line 1714 of file standard_impl.h.

◆ REDUCT_INTROSPECTION_IMPL

#define REDUCT_INTROSPECTION_IMPL (   _name,
  _predicate_macro 
)
Value:
{ \
REDUCT_UNUSED(reduct); \
REDUCT_INTROSPECTION_LOOP(_predicate_macro(&argv[i])); \
}

Definition at line 1729 of file standard_impl.h.

◆ REDUCT_PREDICATE_IS_STRING

#define REDUCT_PREDICATE_IS_STRING (   _h)    (REDUCT_HANDLE_IS_ATOM(_h) && !REDUCT_HANDLE_IS_NUMBER_SHAPED(_h))

Definition at line 1745 of file standard_impl.h.

◆ REDUCT_PREDICATE_IS_EMPTY

#define REDUCT_PREDICATE_IS_EMPTY (   _h)    (reduct_handle_item(reduct, _h)->length == 0)

Definition at line 1748 of file standard_impl.h.

◆ REDUCT_PREDICATE_IS_NIL

#define REDUCT_PREDICATE_IS_NIL (   _h)    (*(_h) == reduct_handle_nil(reduct))

Definition at line 1751 of file standard_impl.h.

◆ REDUCT_GET_NUMERIC_IMPL

#define REDUCT_GET_NUMERIC_IMPL (   _name,
  _res,
  _type,
  _other,
  _targetUnion,
  _otherUnion 
)
Value:
REDUCT_API reduct_handle_t reduct_get_##_name(reduct_t* reduct, reduct_handle_t* handle) \
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
if (REDUCT_HANDLE_IS_##_type(handle)) \
{ \
return *handle; \
} \
if (REDUCT_HANDLE_IS_##_other(handle)) \
{ \
return REDUCT_HANDLE_FROM_##_res((reduct_##_name##_t)REDUCT_HANDLE_TO_##_other(handle)); \
} \
reduct_item_t* item = reduct_handle_item(reduct, handle); \
if (item->flags & REDUCT_ITEM_FLAG_##_type##_SHAPED) \
{ \
return REDUCT_HANDLE_FROM_##_res(item->atom._targetUnion); \
} \
if (item->flags & REDUCT_ITEM_FLAG_##_other##_SHAPED) \
{ \
return REDUCT_HANDLE_FROM_##_res((reduct_##_name##_t)item->atom._otherUnion); \
} \
REDUCT_ERROR_RUNTIME(reduct, "expected " #_name ", got %s", reduct_item_type_str(item->type)); \
}
REDUCT_API struct reduct_item * reduct_handle_item(struct reduct *reduct, reduct_handle_t *handle)
Ensure that a handle is an item and return the pointer.
REDUCT_API const char * reduct_item_type_str(reduct_item_type_t type)
Get the string representation of an Reduct item type.
Definition item_impl.h:139
reduct_item_flags_t flags
Flags for the item.
Definition item.h:60
reduct_atom_t atom
An atom.
Definition item.h:66
reduct_item_type_t type
The type of the item.
Definition item.h:61

Definition at line 1754 of file standard_impl.h.

◆ REDUCT_MATH_MIN_MAX_IMPL

#define REDUCT_MATH_MIN_MAX_IMPL (   _name,
  _op 
)
Value:
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
if (argc == 0) \
{ \
return reduct_handle_nil(reduct); \
} \
reduct_handle_t current = argv[0]; \
for (reduct_size_t i = 1; i < argc; i++) \
{ \
reduct_handle_promote(reduct, &current, &argv[i], &prom); \
{ \
current = REDUCT_HANDLE_FROM_INT(prom.a.intVal _op prom.b.intVal ? prom.a.intVal : prom.b.intVal); \
} \
else \
{ \
current = \
REDUCT_HANDLE_FROM_FLOAT(prom.a.floatVal _op prom.b.floatVal ? prom.a.floatVal : prom.b.floatVal); \
} \
} \
return current; \
}
REDUCT_API reduct_handle_t reduct_handle_nil(struct reduct *reduct)
Get the constant nil handle.
@ REDUCT_PROMOTION_TYPE_INT
Definition handle.h:374
Promotion result for numeric operations.
Definition handle.h:383
reduct_int64_t intVal
Definition handle.h:386
reduct_float_t floatVal
Definition handle.h:387
union reduct_promotion_t::@7 a
union reduct_promotion_t::@8 b
reduct_promotion_type_t type
Definition handle.h:384

Definition at line 2301 of file standard_impl.h.

◆ REDUCT_MATH_UNARY_IMPL

#define REDUCT_MATH_UNARY_IMPL (   _name,
  _int_func,
  _float_func 
)
Value:
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
{ \
reduct_handle_t iVal = reduct_get_int(reduct, val); \
return REDUCT_HANDLE_FROM_INT((reduct_int64_t)_int_func(i)); \
} \
reduct_handle_t floatVal = reduct_get_float(reduct, val); \
return REDUCT_HANDLE_FROM_FLOAT((reduct_float_t)_float_func(f)); \
}
int64_t reduct_int64_t
Definition defs.h:92
double reduct_float_t
Definition defs.h:102
#define REDUCT_HANDLE_TO_INT(_handle)
Get the integer value of a handle.
Definition handle.h:236
#define REDUCT_HANDLE_FROM_FLOAT(_val)
Create a handle from a float.
Definition handle.h:62
#define REDUCT_HANDLE_TO_FLOAT(_handle)
Get the float value of a handle.
Definition handle.h:244
#define REDUCT_HANDLE_IS_INT_SHAPED(_handle)
Check if a handle is an integer of references a integer shaped item.
Definition handle.h:134
REDUCT_API reduct_handle_t reduct_get_float(struct reduct *reduct, reduct_handle_t *handle)
REDUCT_API reduct_handle_t reduct_get_int(struct reduct *reduct, reduct_handle_t *handle)

Definition at line 2361 of file standard_impl.h.

◆ REDUCT_INT_ABS

#define REDUCT_INT_ABS (   _x)    ((_x) < 0 ? -(_x) : (_x))

Definition at line 2376 of file standard_impl.h.

◆ REDUCT_MATH_UNARY_TO_INT_IMPL

#define REDUCT_MATH_UNARY_TO_INT_IMPL (   _name,
  _float_func 
)
Value:
REDUCT_API reduct_handle_t _name(struct reduct* reduct, reduct_handle_t* val) \
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
{ \
return reduct_get_int(reduct, val); \
} \
reduct_handle_t floatVal = reduct_get_float(reduct, val); \
return REDUCT_HANDLE_FROM_INT((reduct_int64_t)_float_func(f)); \
}

Definition at line 2381 of file standard_impl.h.

◆ REDUCT_MATH_UNARY_FLOAT_IMPL

#define REDUCT_MATH_UNARY_FLOAT_IMPL (   _name,
  _func 
)
Value:
REDUCT_API reduct_handle_t _name(struct reduct* reduct, reduct_handle_t* val) \
{ \
REDUCT_ASSERT(reduct != REDUCT_NULL); \
reduct_handle_t fv = reduct_get_float(reduct, val); \
}

Definition at line 2443 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_0

#define REDUCT_STDLIB_WRAPPER_0 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity(reduct, argc, 0, #_name); \
(void)argv; \
return _impl(reduct); \
}

Definition at line 2501 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_1

#define REDUCT_STDLIB_WRAPPER_1 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity(reduct, argc, 1, #_name); \
return _impl(reduct, &argv[0]); \
}

Definition at line 2509 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_2

#define REDUCT_STDLIB_WRAPPER_2 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity(reduct, argc, 2, #_name); \
return _impl(reduct, &argv[0], &argv[1]); \
}

Definition at line 2516 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_3

#define REDUCT_STDLIB_WRAPPER_3 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity(reduct, argc, 3, #_name); \
return _impl(reduct, &argv[0], &argv[1], &argv[2]); \
}

Definition at line 2523 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_R12

#define REDUCT_STDLIB_WRAPPER_R12 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity_range(reduct, argc, 1, 2, #_name); \
return _impl(reduct, &argv[0], argc == 2 ? &argv[1] : REDUCT_NULL); \
}

Definition at line 2530 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_R23

#define REDUCT_STDLIB_WRAPPER_R23 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity_range(reduct, argc, 2, 3, #_name); \
return _impl(reduct, &argv[0], &argv[1], argc == 3 ? &argv[2] : REDUCT_NULL); \
}

Definition at line 2537 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_R34

#define REDUCT_STDLIB_WRAPPER_R34 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity_range(reduct, argc, 3, 4, #_name); \
return _impl(reduct, &argv[0], &argv[1], &argv[2], argc == 4 ? &argv[3] : REDUCT_NULL); \
}

Definition at line 2544 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_ARG2

#define REDUCT_STDLIB_WRAPPER_ARG2 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_arity(reduct, argc, 2, #_name); \
return _impl(reduct, &argv[0], &argv[1]); \
}

Definition at line 2551 of file standard_impl.h.

◆ REDUCT_STDLIB_WRAPPER_V1

#define REDUCT_STDLIB_WRAPPER_V1 (   _name,
  _impl 
)
Value:
static reduct_handle_t reduct_stdlib_##_name(reduct_t* reduct, reduct_size_t argc, reduct_handle_t* argv) \
{ \
reduct_error_check_min_arity(reduct, argc, 1, #_name); \
return _impl(reduct, argc, argv); \
}

Definition at line 2558 of file standard_impl.h.

Function Documentation

◆ reduct_assert()

REDUCT_API reduct_handle_t reduct_assert ( reduct_t reduct,
reduct_handle_t cond,
reduct_handle_t msg 
)

Definition at line 17 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_throw()

REDUCT_API reduct_handle_t reduct_throw ( reduct_t reduct,
reduct_handle_t msg 
)

Definition at line 32 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_try()

REDUCT_API reduct_handle_t reduct_try ( reduct_t reduct,
reduct_handle_t callable,
reduct_handle_t catchFn 
)

Definition at line 44 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_map()

REDUCT_API reduct_handle_t reduct_map ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t callable 
)

Definition at line 68 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_filter()

REDUCT_API reduct_handle_t reduct_filter ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t callable 
)

Definition at line 91 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_reduce()

REDUCT_API reduct_handle_t reduct_reduce ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t initial,
reduct_handle_t callable 
)

Definition at line 117 of file standard_impl.h.

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

◆ reduct_apply()

REDUCT_API reduct_handle_t reduct_apply ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t callable 
)

Definition at line 154 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_eval_maybe_call()

static reduct_handle_t reduct_eval_maybe_call ( reduct_t reduct,
reduct_handle_t  fn,
reduct_handle_t arg 
)
inlinestatic

Definition at line 193 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_sort_merge()

static void reduct_sort_merge ( reduct_t reduct,
reduct_handle_t  callable,
reduct_handle_t a,
reduct_size_t  left,
reduct_size_t  right,
reduct_size_t  end,
reduct_handle_t b 
)
static

Definition at line 230 of file standard_impl.h.

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

◆ reduct_sort()

REDUCT_API reduct_handle_t reduct_sort ( reduct_t reduct,
reduct_handle_t listHandle,
reduct_handle_t callableHandle 
)

Definition at line 279 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_handle_normalize_index()

static reduct_int64_t reduct_handle_normalize_index ( reduct_t reduct,
reduct_handle_t index,
reduct_size_t  length 
)
inlinestatic

Definition at line 349 of file standard_impl.h.

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

◆ reduct_sequence_normalize_range()

static void reduct_sequence_normalize_range ( reduct_t reduct,
reduct_handle_t startH,
reduct_handle_t endH,
reduct_size_t  length,
reduct_size_t outStart,
reduct_size_t outEnd 
)
inlinestatic

Definition at line 361 of file standard_impl.h.

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

◆ reduct_list_find_entry()

static reduct_handle_t reduct_list_find_entry ( reduct_t reduct,
reduct_item_t listItem,
reduct_handle_t key 
)
inlinestatic

Definition at line 383 of file standard_impl.h.

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

◆ reduct_list_get_entry()

static reduct_bool_t reduct_list_get_entry ( reduct_t reduct,
reduct_handle_t entryH,
reduct_handle_t outKey,
reduct_handle_t outVal 
)
inlinestatic

Definition at line 404 of file standard_impl.h.

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

◆ reduct_len()

REDUCT_API reduct_handle_t reduct_len ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 429 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_concat()

REDUCT_API reduct_handle_t reduct_concat ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 491 of file standard_impl.h.

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

◆ reduct_sequence_edge()

static reduct_handle_t reduct_sequence_edge ( reduct_t reduct,
reduct_handle_t handle,
reduct_bool_t  first 
)
inlinestatic

Definition at line 548 of file standard_impl.h.

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

◆ reduct_first()

REDUCT_API reduct_handle_t reduct_first ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 570 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_last()

REDUCT_API reduct_handle_t reduct_last ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 577 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_sequence_trim()

static reduct_handle_t reduct_sequence_trim ( reduct_t reduct,
reduct_handle_t handle,
reduct_bool_t  rest 
)
inlinestatic

Definition at line 584 of file standard_impl.h.

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

◆ reduct_rest()

REDUCT_API reduct_handle_t reduct_rest ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 607 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_init()

REDUCT_API reduct_handle_t reduct_init ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 614 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_nth()

REDUCT_API reduct_handle_t reduct_nth ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t index,
reduct_handle_t defaultVal 
)

Definition at line 621 of file standard_impl.h.

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

◆ reduct_handle_get_char()

static char reduct_handle_get_char ( reduct_t reduct,
reduct_handle_t handle,
char  defaultChar 
)
inlinestatic

Definition at line 646 of file standard_impl.h.

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

◆ reduct_assoc()

REDUCT_API reduct_handle_t reduct_assoc ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t index,
reduct_handle_t value,
reduct_handle_t fillVal 
)

Definition at line 654 of file standard_impl.h.

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

◆ reduct_update()

REDUCT_API reduct_handle_t reduct_update ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t index,
reduct_handle_t callable,
reduct_handle_t fillVal 
)

Definition at line 768 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_index_of()

REDUCT_API reduct_handle_t reduct_index_of ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t target 
)

Definition at line 792 of file standard_impl.h.

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

◆ reduct_reverse()

REDUCT_API reduct_handle_t reduct_reverse ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 842 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_slice()

REDUCT_API reduct_handle_t reduct_slice ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t startH,
reduct_handle_t endH 
)

Definition at line 889 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_get_in()

REDUCT_API reduct_handle_t reduct_get_in ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t path,
reduct_handle_t defaultVal 
)

Definition at line 1167 of file standard_impl.h.

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

◆ reduct_assoc_in()

REDUCT_API reduct_handle_t reduct_assoc_in ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t path,
reduct_handle_t val 
)

Definition at line 1205 of file standard_impl.h.

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

◆ reduct_dissoc_in()

REDUCT_API reduct_handle_t reduct_dissoc_in ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t path 
)

Definition at line 1274 of file standard_impl.h.

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

◆ reduct_update_in()

REDUCT_API reduct_handle_t reduct_update_in ( reduct_t reduct,
reduct_handle_t list,
reduct_handle_t path,
reduct_handle_t callable 
)

Definition at line 1327 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_list_project()

static reduct_handle_t reduct_list_project ( reduct_t reduct,
reduct_handle_t listHandle,
reduct_size_t  index,
const char *  name 
)
inlinestatic

Definition at line 1338 of file standard_impl.h.

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

◆ reduct_keys()

REDUCT_API reduct_handle_t reduct_keys ( reduct_t reduct,
reduct_handle_t listHandle 
)

Definition at line 1364 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_values()

REDUCT_API reduct_handle_t reduct_values ( reduct_t reduct,
reduct_handle_t listHandle 
)

Definition at line 1370 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_merge()

REDUCT_API reduct_handle_t reduct_merge ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 1376 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_explode()

REDUCT_API reduct_handle_t reduct_explode ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 1411 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_implode()

REDUCT_API reduct_handle_t reduct_implode ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 1435 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_repeat()

REDUCT_API reduct_handle_t reduct_repeat ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t count 
)

Definition at line 1474 of file standard_impl.h.

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

◆ reduct_sequence_check_edge()

static reduct_handle_t reduct_sequence_check_edge ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t target,
reduct_bool_t  start,
const char *  name 
)
inlinestatic

Definition at line 1499 of file standard_impl.h.

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

◆ reduct_starts_with()

REDUCT_API reduct_handle_t reduct_starts_with ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t prefix 
)

Definition at line 1534 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_ends_with()

REDUCT_API reduct_handle_t reduct_ends_with ( reduct_t reduct,
reduct_handle_t handle,
reduct_handle_t suffix 
)

Definition at line 1539 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_join()

REDUCT_API reduct_handle_t reduct_join ( reduct_t reduct,
reduct_handle_t listHandle,
reduct_handle_t sepHandle 
)

Definition at line 1544 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_split()

REDUCT_API reduct_handle_t reduct_split ( reduct_t reduct,
reduct_handle_t srcHandle,
reduct_handle_t sepHandle 
)

Definition at line 1599 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_string_transform()

static reduct_handle_t reduct_string_transform ( reduct_t reduct,
reduct_handle_t srcHandle,
reduct_bool_t  upper 
)
inlinestatic

Definition at line 1645 of file standard_impl.h.

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

◆ reduct_upper()

REDUCT_API reduct_handle_t reduct_upper ( reduct_t reduct,
reduct_handle_t srcHandle 
)

Definition at line 1668 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_lower()

REDUCT_API reduct_handle_t reduct_lower ( reduct_t reduct,
reduct_handle_t srcHandle 
)

Definition at line 1674 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_trim()

REDUCT_API reduct_handle_t reduct_trim ( reduct_t reduct,
reduct_handle_t srcHandle 
)

Definition at line 1680 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_get_string()

REDUCT_API reduct_handle_t reduct_get_string ( reduct_t reduct,
reduct_handle_t handle 
)

Definition at line 1781 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_path_copy()

static void reduct_path_copy ( reduct_t reduct,
char *  dest,
const char *  src,
reduct_size_t  len,
reduct_size_t  max 
)
static

Definition at line 1807 of file standard_impl.h.

Here is the caller graph for this function:

◆ reduct_resolve_path()

static void reduct_resolve_path ( reduct_t reduct,
const char *  path,
reduct_size_t  pathLen,
char *  outPath,
reduct_size_t  maxLen 
)
static

Definition at line 1817 of file standard_impl.h.

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

◆ reduct_get_resolved_path()

static void reduct_get_resolved_path ( reduct_t reduct,
reduct_handle_t pathHandle,
char *  outBuf 
)
static

Definition at line 1895 of file standard_impl.h.

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

◆ reduct_print()

REDUCT_API reduct_handle_t reduct_print ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 2049 of file standard_impl.h.

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

◆ reduct_println()

REDUCT_API reduct_handle_t reduct_println ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 2067 of file standard_impl.h.

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

◆ reduct_format()

REDUCT_API reduct_handle_t reduct_format ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)

Definition at line 2109 of file standard_impl.h.

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

◆ reduct_now()

REDUCT_API reduct_handle_t reduct_now ( reduct_t reduct)

Definition at line 2230 of file standard_impl.h.

◆ reduct_uptime()

REDUCT_API reduct_handle_t reduct_uptime ( reduct_t reduct)

Definition at line 2239 of file standard_impl.h.

◆ reduct_clamp()

REDUCT_API reduct_handle_t reduct_clamp ( reduct_t reduct,
reduct_handle_t val,
reduct_handle_t minVal,
reduct_handle_t maxVal 
)

Definition at line 2330 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_pow()

REDUCT_API reduct_handle_t reduct_pow ( reduct_t reduct,
reduct_handle_t base,
reduct_handle_t exp 
)

Definition at line 2398 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_stdlib_reduce()

static reduct_handle_t reduct_stdlib_reduce ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2584 of file standard_impl.h.

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

◆ reduct_stdlib_range()

static reduct_handle_t reduct_stdlib_range ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2596 of file standard_impl.h.

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

◆ reduct_stdlib_concat()

static reduct_handle_t reduct_stdlib_concat ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2612 of file standard_impl.h.

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

◆ reduct_stdlib_repeat()

static reduct_handle_t reduct_stdlib_repeat ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2643 of file standard_impl.h.

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

◆ reduct_stdlib_eval_impl()

static reduct_handle_t reduct_stdlib_eval_impl ( reduct_t reduct,
reduct_handle_t arg 
)
static

Definition at line 2661 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_stdlib_parse_impl()

static reduct_handle_t reduct_stdlib_parse_impl ( reduct_t reduct,
reduct_handle_t arg 
)
static

Definition at line 2667 of file standard_impl.h.

Here is the call graph for this function:

◆ reduct_stdlib_print()

static reduct_handle_t reduct_stdlib_print ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2683 of file standard_impl.h.

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

◆ reduct_stdlib_println()

static reduct_handle_t reduct_stdlib_println ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2688 of file standard_impl.h.

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

◆ reduct_stdlib_format()

static reduct_handle_t reduct_stdlib_format ( reduct_t reduct,
reduct_size_t  argc,
reduct_handle_t argv 
)
static

Definition at line 2696 of file standard_impl.h.

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

◆ reduct_stdlib_register()

REDUCT_API void reduct_stdlib_register ( reduct_t reduct,
reduct_stdlib_sets_t  sets 
)

Definition at line 2733 of file standard_impl.h.

Here is the call graph for this function: