x-engine-c v0.2.13
The C engine for x-lang
Loading...
Searching...
No Matches
x-prim.c File Reference

Primitive evaluation helpers, environment extension, and registration. More...

#include "x-prim.h"
#include "x-syntax.h"
#include "x-alist.h"
#include "x-eval.h"
#include "x-env.h"
#include "x-type.h"
#include "x-type/list.h"
#include "x-type/prim.h"
#include "x-type/symbol.h"

Functions

void x_callable_bind (x_obj_t *p_base, x_char_t *name, x_fn_t fn)
 
void x_value_bind (x_obj_t *p_base, x_char_t *name, x_obj_t *p_val)
 
void x_callable_bind_table (x_obj_t *p_base, const x_callable_entry_t *table, int count)
 
x_obj_tx_prims (x_obj_t *p_base)
 
static x_obj_tx_prims_domain_pair (x_obj_t *p_base, x_obj_t *p_ns)
 
static void x_prims_file (x_obj_t *p_base, x_obj_t *p_ns, x_obj_t *p_entry)
 
static void x_prims_add (x_obj_t *p_base, x_char_t *ns, x_char_t *method, x_fn_t fn)
 
static int x_prims_name_kept (const x_char_t *name)
 
static int x_prims_ns_deregistered (const x_char_t *ns)
 
void x_prims_bind_table (x_obj_t *p_base, const x_prim_entry_t *table, int count)
 
x_obj_tx_prim_register (x_obj_t *p_base, x_obj_t *p_args)
 

Detailed Description

Primitive evaluation helpers, environment extension, and registration.

Author
Jon Ruttan (jonru.nosp@m.ttan.nosp@m.@gmai.nosp@m.l.co.nosp@m.m)

Function Documentation

◆ x_prim_register()

x_obj_t * x_prim_register ( x_obj_t p_base,
x_obj_t p_args 
)

Register all built-in primitives into the environment.

Binds the #t and #f boolean singletons, caches them in the base object, then delegates to each primitive module's register function (core, quote, binding, closure, control, arith, pred, string, io, type, ffi, callcc).

Parameters
p_basex_obj_t* – Base (execution context)
p_argsx_obj_t* – Unused
Returns
x_obj_t* – p_base

◆ x_prims_add()

static void x_prims_add ( x_obj_t p_base,
x_char_t ns,
x_char_t method,
x_fn_t  fn 
)
static

◆ x_prims_domain_pair()

static x_obj_t * x_prims_domain_pair ( x_obj_t p_base,
x_obj_t p_ns 
)
static

◆ x_prims_file()

static void x_prims_file ( x_obj_t p_base,
x_obj_t p_ns,
x_obj_t p_entry 
)
static

◆ x_prims_name_kept()

static int x_prims_name_kept ( const x_char_t name)
static

◆ x_prims_ns_deregistered()

static int x_prims_ns_deregistered ( const x_char_t ns)
static