Skip to main content

Module interp

Module interp 

Source
Expand description

Interpreter-level builtins β€” functions that receive BuiltinContext so they can call back into the active interpreter without direct TLS lookups. Each is auto-registered via #[interpreter_builtin].

StaticsΒ§

__INTERP_REG_INTERP_AGGREGATE πŸ”’
__INTERP_REG_INTERP_APPLY πŸ”’
__INTERP_REG_INTERP_ASSIGN πŸ”’
__INTERP_REG_INTERP_AS_ENVIRONMENT πŸ”’
__INTERP_REG_INTERP_BASEENV πŸ”’
__INTERP_REG_INTERP_BINDING_IS_LOCKED πŸ”’
__INTERP_REG_INTERP_BUILTIN_COUNT πŸ”’
__INTERP_REG_INTERP_BY πŸ”’
__INTERP_REG_INTERP_DOT_GET_NAMESPACE_INFO πŸ”’
__INTERP_REG_INTERP_DOT_PRIMITIVE πŸ”’
__INTERP_REG_INTERP_DO_CALL πŸ”’
__INTERP_REG_INTERP_EMPTYENV πŸ”’
__INTERP_REG_INTERP_ENVIRONMENT πŸ”’
__INTERP_REG_INTERP_ENVIRONMENT_IS_LOCKED πŸ”’
__INTERP_REG_INTERP_EVAL πŸ”’
__INTERP_REG_INTERP_EXISTS πŸ”’
__INTERP_REG_INTERP_FILTER πŸ”’
__INTERP_REG_INTERP_FIND πŸ”’
__INTERP_REG_INTERP_FIND_ON_SEARCH_PATH πŸ”’
__INTERP_REG_INTERP_FORMAT πŸ”’
__INTERP_REG_INTERP_GET πŸ”’
__INTERP_REG_INTERP_GET0 πŸ”’
__INTERP_REG_INTERP_GET_NAMESPACE πŸ”’
__INTERP_REG_INTERP_GET_NAMESPACE_EXPORTS πŸ”’
__INTERP_REG_INTERP_GET_NAMESPACE_INFO πŸ”’
__INTERP_REG_INTERP_GET_OPTION πŸ”’
__INTERP_REG_INTERP_GLOBALENV πŸ”’
__INTERP_REG_INTERP_INVISIBLE πŸ”’
__INTERP_REG_INTERP_IS_ACTIVE_BINDING πŸ”’
__INTERP_REG_INTERP_IS_NAMESPACE_LOADED πŸ”’
__INTERP_REG_INTERP_LAPPLY πŸ”’
__INTERP_REG_INTERP_LOADED_NAMESPACES πŸ”’
__INTERP_REG_INTERP_LOCK_BINDING πŸ”’
__INTERP_REG_INTERP_LOCK_ENVIRONMENT πŸ”’
__INTERP_REG_INTERP_LS πŸ”’
__INTERP_REG_INTERP_MAKE_ACTIVE_BINDING πŸ”’
__INTERP_REG_INTERP_MAP πŸ”’
__INTERP_REG_INTERP_MAPPLY πŸ”’
__INTERP_REG_INTERP_MATCH_CALL πŸ”’
__INTERP_REG_INTERP_NARGS πŸ”’
__INTERP_REG_INTERP_NEGATE πŸ”’
__INTERP_REG_INTERP_NEXT_METHOD πŸ”’
__INTERP_REG_INTERP_OPTIONS πŸ”’
__INTERP_REG_INTERP_OP_ADD πŸ”’
__INTERP_REG_INTERP_OP_AND πŸ”’
__INTERP_REG_INTERP_OP_DIV πŸ”’
__INTERP_REG_INTERP_OP_EQ πŸ”’
__INTERP_REG_INTERP_OP_GE πŸ”’
__INTERP_REG_INTERP_OP_GT πŸ”’
__INTERP_REG_INTERP_OP_INTDIV πŸ”’
__INTERP_REG_INTERP_OP_LE πŸ”’
__INTERP_REG_INTERP_OP_LT πŸ”’
__INTERP_REG_INTERP_OP_MOD πŸ”’
__INTERP_REG_INTERP_OP_MUL πŸ”’
__INTERP_REG_INTERP_OP_NE πŸ”’
__INTERP_REG_INTERP_OP_NOT πŸ”’
__INTERP_REG_INTERP_OP_OR πŸ”’
__INTERP_REG_INTERP_OP_POW πŸ”’
__INTERP_REG_INTERP_OP_SUB πŸ”’
__INTERP_REG_INTERP_OUTER πŸ”’
__INTERP_REG_INTERP_PACKAGE_DESCRIPTION πŸ”’
__INTERP_REG_INTERP_PACKAGE_VERSION πŸ”’
__INTERP_REG_INTERP_PARENT_FRAME πŸ”’
__INTERP_REG_INTERP_PARSE πŸ”’
__INTERP_REG_INTERP_POSITION πŸ”’
__INTERP_REG_INTERP_PRINT πŸ”’
__INTERP_REG_INTERP_PRINT_DATA_FRAME πŸ”’
__INTERP_REG_INTERP_PRINT_FACTOR πŸ”’
__INTERP_REG_INTERP_PRINT_MATRIX πŸ”’
__INTERP_REG_INTERP_RAPPLY πŸ”’
__INTERP_REG_INTERP_RECALL πŸ”’
__INTERP_REG_INTERP_REDUCE πŸ”’
__INTERP_REG_INTERP_REG_FINALIZER πŸ”’
__INTERP_REG_INTERP_SAPPLY πŸ”’
__INTERP_REG_INTERP_SEARCH πŸ”’
__INTERP_REG_INTERP_SOURCE πŸ”’
__INTERP_REG_INTERP_SPLIT πŸ”’
__INTERP_REG_INTERP_SUMMARY πŸ”’
__INTERP_REG_INTERP_SYS_CALL πŸ”’
__INTERP_REG_INTERP_SYS_CALLS πŸ”’
__INTERP_REG_INTERP_SYS_FRAME πŸ”’
__INTERP_REG_INTERP_SYS_FRAMES πŸ”’
__INTERP_REG_INTERP_SYS_FUNCTION πŸ”’
__INTERP_REG_INTERP_SYS_NFRAME πŸ”’
__INTERP_REG_INTERP_SYS_ON_EXIT πŸ”’
__INTERP_REG_INTERP_SYS_PARENTS πŸ”’
__INTERP_REG_INTERP_SYS_SOURCE πŸ”’
__INTERP_REG_INTERP_TAPPLY πŸ”’
__INTERP_REG_INTERP_UNSPLIT πŸ”’
__INTERP_REG_INTERP_VAPPLY πŸ”’
__INTERP_REG_INTERP_VECTORIZE πŸ”’

FunctionsΒ§

aggregate_formula πŸ”’
Formula interface for aggregate: aggregate(y ~ x, data=df, FUN=mean)
aggregate_standard πŸ”’
Standard (non-formula) aggregate: aggregate(x, by, FUN)
build_outer_matrix πŸ”’
Build an RVector matrix with class, dim, and optional dimnames.
collect_symbol_names πŸ”’
Collect all symbol names from an expression (handles +, ., and bare symbols).
combine_items_to_vector πŸ”’
Combine a list of scalar RValues back into a single vector RValue.
df_column_names πŸ”’
Get all column names from a data frame.
df_get_column πŸ”’
Get a column from a data frame by name.
do_call_delayed_assign πŸ”’
do.call(delayedAssign, list(name, expr, eval.env, assign.env)) handler.
do_call_on_exit πŸ”’
Handle do.call(on.exit, list(expr, add), envir=env).
eval_apply πŸ”’
eval_binop πŸ”’
explicit_classes πŸ”’
Get explicit class attributes from an RValue. Returns an empty vec for objects without a class attribute.
extract_dimnames πŸ”’
Extract dimnames from a matrix’s attributes. Returns (row_names, col_names) as optional Vec.
extract_fail_fast πŸ”’
Extract fail_fast from named args and return the remaining named args. Default is false (collect all errors).
extract_formula_vars πŸ”’
Extract column names from a formula expression (e.g., y ~ x parses to lhs=y, rhs=x).
format_column_elements πŸ”’
Format individual elements of a vector column for data frame printing.
format_double_with_opts πŸ”’
Format a double value with nsmall, digits, big.mark, and scientific options.
format_factor_labels πŸ”’
Format factor labels as R-style output with line indices.
format_integer_with_opts πŸ”’
Format an integer value with big.mark option.
format_matrix_elements πŸ”’
Format matrix elements as strings, stored in row-major order.
format_significant_digits πŸ”’
Format a double value to a specified number of significant digits.
get_namespace_info_impl πŸ”’
insert_thousands_sep πŸ”’
Insert a thousands separator into the integer part of a numeric string.
interp_aggregate πŸ”’
Aggregate data by groups, applying a function to each group.
interp_apply πŸ”’
Apply a function over rows or columns of a matrix.
interp_as_environment πŸ”’
Coerce a value to an environment.
interp_assign πŸ”’
Assign a value to a variable name in an environment.
interp_baseenv πŸ”’
Return the base environment.
interp_binding_is_locked πŸ”’
Check whether a binding is locked in an environment.
interp_builtin_count πŸ”’
Return the number of builtins registered, optionally filtered by namespace.
interp_by πŸ”’
Apply a function to subsets of a data frame or vector split by a grouping factor.
interp_do_call πŸ”’
Call a function with arguments supplied as a list.
interp_dot_get_namespace_info πŸ”’
.getNamespaceInfo(ns, which) β€” internal version.
interp_dot_primitive πŸ”’
.Primitive(name) β€” look up a primitive/builtin function by name.
interp_emptyenv πŸ”’
Return the empty environment (has no parent and no bindings).
interp_environment πŸ”’
Get or query the environment of a function.
interp_environment_is_locked πŸ”’
Check whether an environment is locked.
interp_eval πŸ”’
Evaluate an expression in a specified environment.
interp_exists πŸ”’
Test whether a variable exists in an environment.
interp_filter πŸ”’
Select elements of a vector or list for which a predicate returns TRUE.
interp_find πŸ”’
Find the first element of a vector for which a predicate returns TRUE.
interp_find_on_search_path πŸ”’
Find which namespace a function belongs to.
interp_format πŸ”’
Format a value as a character string (S3 generic).
interp_get πŸ”’
Look up a variable by name in an environment.
interp_get0 πŸ”’
Like get() but returns a default value instead of erroring when not found.
interp_get_namespace πŸ”’
Get a namespace environment by name.
interp_get_namespace_exports πŸ”’
Get exports from a namespace (list functions in a package).
interp_get_namespace_info πŸ”’
getNamespaceInfo(ns, which) β€” get metadata about a namespace.
interp_get_option πŸ”’
Get the value of a named global option.
interp_globalenv πŸ”’
Return the global environment.
interp_invisible πŸ”’
Return a value invisibly (suppresses auto-printing).
interp_is_active_binding πŸ”’
Check whether a binding is an active binding.
interp_is_namespace_loaded πŸ”’
Check if a namespace is loaded.
interp_lapply πŸ”’
Apply a function over a vector or list, returning a list.
interp_loaded_namespaces πŸ”’
List all loaded namespace names.
interp_lock_binding πŸ”’
Lock a specific binding in an environment.
interp_lock_environment πŸ”’
Lock an environment so no new bindings can be added.
interp_ls πŸ”’
List the names of objects in an environment.
interp_make_active_binding πŸ”’
Create an active binding.
interp_map πŸ”’
Apply a function to corresponding elements of multiple vectors or lists.
interp_mapply πŸ”’
Apply a function to corresponding elements of multiple vectors.
interp_match_call πŸ”’
Return the call expression with arguments matched to formal parameters.
interp_nargs πŸ”’
Get the number of arguments supplied to the current function call.
interp_negate πŸ”’
Negate a predicate function, returning a new function that returns the logical complement of the original.
interp_next_method πŸ”’
Invoke the next method in an S3 method dispatch chain.
interp_op_add πŸ”’
Addition operator as a function (unary positive or binary addition).
interp_op_and πŸ”’
Element-wise logical AND operator as a function.
interp_op_div πŸ”’
Division operator as a function.
interp_op_eq πŸ”’
Equality comparison operator as a function.
interp_op_ge πŸ”’
Greater-than-or-equal comparison operator as a function.
interp_op_gt πŸ”’
Greater-than comparison operator as a function.
interp_op_intdiv πŸ”’
Integer division operator as a function.
interp_op_le πŸ”’
Less-than-or-equal comparison operator as a function.
interp_op_lt πŸ”’
Less-than comparison operator as a function.
interp_op_mod πŸ”’
Modulo operator as a function.
interp_op_mul πŸ”’
Multiplication operator as a function.
interp_op_ne πŸ”’
Inequality comparison operator as a function.
interp_op_not πŸ”’
Logical NOT operator as a function.
interp_op_or πŸ”’
Element-wise logical OR operator as a function.
interp_op_pow πŸ”’
Exponentiation operator as a function.
interp_op_sub πŸ”’
Subtraction operator as a function (unary negation or binary subtraction).
interp_options πŸ”’
Get or set global options.
interp_outer πŸ”’
Outer product of two vectors, applying FUN to each pair of elements.
interp_package_description πŸ”’
Read the DESCRIPTION file for a package, returning all fields as a named list.
interp_package_version πŸ”’
Get the version of an installed package from its DESCRIPTION file.
interp_parent_frame πŸ”’
Get the environment of the parent (calling) frame.
interp_parse πŸ”’
Parse R source text into a language object.
interp_position πŸ”’
Find the position (1-based index) of the first element where a predicate is TRUE.
interp_print πŸ”’
Print a value to stdout (S3 generic).
interp_print_data_frame πŸ”’
Print a data.frame with aligned columns using TabWriter.
interp_print_factor πŸ”’
Print a factor showing level labels instead of integer codes.
interp_print_matrix πŸ”’
Print a matrix with row/column labels.
interp_rapply πŸ”’
Recursively apply a function to elements of a (nested) list.
interp_recall πŸ”’
Recursively call the current function with new arguments.
interp_reduce πŸ”’
Reduce a vector or list to a single value by applying a binary function.
interp_reg_finalizer πŸ”’
Register a function to be called when an environment is garbage collected, or at interpreter exit if onexit = TRUE.
interp_sapply πŸ”’
Apply a function over a vector or list, simplifying the result.
interp_search πŸ”’
Return the search path as a character vector.
interp_source πŸ”’
Read and evaluate an R source file.
interp_split πŸ”’
Split a vector or data frame into groups defined by a factor.
interp_summary πŸ”’
Summarize an object (S3 generic).
interp_sys_call πŸ”’
Get the call expression of a frame on the call stack.
interp_sys_calls πŸ”’
Get the list of all calls on the call stack.
interp_sys_frame πŸ”’
Get the environment of a frame on the call stack.
interp_sys_frames πŸ”’
Get the list of all environments on the call stack.
interp_sys_function πŸ”’
Get the function of a frame on the call stack.
interp_sys_nframe πŸ”’
Get the number of frames on the call stack.
interp_sys_on_exit πŸ”’
Get the on.exit expression for the current frame.
interp_sys_parents πŸ”’
Get the parent frame indices for all frames on the call stack.
interp_sys_source πŸ”’
Read and evaluate an R source file in a specified environment.
interp_tapply πŸ”’
Apply a function to groups of values defined by a factor/index.
interp_unsplit πŸ”’
Reverse of split: reassemble a vector from a split list.
interp_vapply πŸ”’
Apply a function over a vector or list with a type-checked return template.
interp_vectorize πŸ”’
Create a vectorized version of a function.
language_or_null πŸ”’
match_fun πŸ”’
Resolve a function specification: accepts an RValue::Function directly, or a string naming a function to look up in the environment. Equivalent to R’s match.fun().
optional_frame_index πŸ”’
outer_general πŸ”’
General outer product: call FUN(x_i, y_j) for each pair and collect into a matrix.
outer_names πŸ”’
Extract the β€œnames” attribute from an RValue as a list of optional strings.
quantile_type7 πŸ”’
Compute a quantile using R’s type 7 algorithm (the default).
rapply_collect πŸ”’
Helper: collect results of applying f to matching leaf (non-list) elements.
rapply_matches_class πŸ”’
Check if an RValue’s type name matches one of the given class names.
rapply_replace πŸ”’
Helper: recursively apply f, preserving list structure (β€œreplace” mode).
rvalue_to_expr πŸ”’
Convert an RValue to an Expr for use in match.call() reconstructed calls.
rvalue_to_items πŸ”’
Convert an RValue to a Vec of individual items (for apply/map/filter/reduce).
set_outer_dimnames πŸ”’
Set dimnames on an outer product result matrix if X or Y had names.
simplify_apply_results πŸ”’
Simplify apply() results: if all results are scalars, return a vector; if all are equal-length vectors, return a matrix; otherwise return a list.
split_impl πŸ”’
Internal split implementation shared by split() and aggregate().
try_s3_dispatch πŸ”’
Try S3 dispatch for a generic function. Returns Ok(Some(result)) if a method was found and called, Ok(None) if no method exists (caller should fall through to default behavior).