Primitive functions in Scheme are implemented as C functions that take
two arguments, an argument count and a vector of
Scheme_Object
s. Each primitive is responsible for checking for
the correct number of arguments-allowing maximum flexibility for
procedures of variable arity-and for checking the types of its
arguments. All arguments to a primitive function are evaluated before
they are passed to the primitive, following Scheme semantics. If the
application writer wants to create a primitive that doesn't evaluate
its arguments, she must use a syntax primitive. C functions are
turned into libscheme
primitives with the
scheme_make_prim()
function that accepts the C function as an
argument and returns a new Scheme object of type
scheme_prim_type
.