Skip to main content

Module convert

Module convert 

Source
Expand description

RValue ↔ SEXP conversion.

Converts between miniR’s RValue types and the C-compatible SEXP layout used by native package code. Handles the type differences:

  • miniR Integer is i64, R INTEGER is i32 → truncate with overflow check
  • miniR Logical is Option<bool>, R LOGICAL is i32 (TRUE=1, FALSE=0, NA=NA_INTEGER)
  • miniR uses NullableBuffer bitmaps, R uses sentinel values (NA_REAL, NA_INTEGER)

Functions§

apply_attrs_to_sexp 🔒
Apply RValue attributes (dim, names, class, dimnames, etc.) to a SEXP.
character_to_sexp 🔒
complex_to_sexp 🔒
double_to_sexp 🔒
env_from_sexp
Extract an Environment from an ENVSXP. Returns None if the SEXP isn’t an ENVSXP.
env_to_sexp 🔒
Convert an Environment to an ENVSXP.
expr_to_sexp 🔒
Convert an Expr to a SEXP for building LANGSXP pairlists.
integer_to_sexp 🔒
language_to_sexp 🔒
Convert a Language (call) to a LANGSXP pairlist.
list_to_sexp 🔒
logical_to_sexp 🔒
raw_to_sexp 🔒
read_sexp_attrs 🔒
Read attributes from a SEXP pairlist (LISTSXP chain) and apply to an RValue.
rvalue_to_sexp
Convert an RValue to a SEXP for passing to native C code.
sexp_complex_to_rvalue 🔒
sexp_int_to_rvalue 🔒
sexp_lgl_to_rvalue 🔒
sexp_raw_to_rvalue 🔒
sexp_real_to_rvalue 🔒
sexp_str_to_rvalue 🔒
sexp_to_rvalue
Convert a SEXP result from native C code back to an RValue.
sexp_vec_to_rvalue 🔒
vector_to_sexp 🔒