Next: Defining Subrs, Previous: Header Cells, Up: Data Types [Contents][Index]
A Subr is a header whose CDR
points to a C code procedure.
Scheme primitive procedures are subrs. Except for the arithmetic
tc7_cxr
s, the C code procedures will be passed arguments (and
return results) of type SCM
.
associative C function of 2 arguments. Examples are +
, -
,
*
, /
, max
, and min
.
C function of no arguments.
C function of one argument.
These subrs are handled specially. If inexact numbers are enabled, the
CDR
should be a function which takes and returns type
double
. Conversions are handled in the interpreter.
floor
, ceiling
, truncate
, round
,
real-sqrt
, real-exp
, real-ln
, real-sin
,
real-cos
, real-tan
, real-asin
, real-acos
, real-atan
,
real-sinh
, real-cosh
, real-tanh
, real-asinh
, real-acosh
,
real-atanh
, and exact->inexact
are defined this way.
If the CDR
is 0
(NULL
), the name string of the
procedure is used to control traversal of its list structure argument.
car
, cdr
, caar
, cadr
, cdar
,
cddr
, caaar
, caadr
, cadar
, caddr
,
cdaar
, cdadr
, cddar
, cdddr
, caaaar
,
caaadr
, caadar
, caaddr
, cadaar
,
cadadr
, caddar
, cadddr
, cdaaar
,
cdaadr
, cdadar
, cdaddr
, cddaar
,
cddadr
, cdddar
, and cddddr
are defined this way.
C function of 3 arguments.
C function of 2 arguments.
transitive relational predicate C function of 2 arguments. The C
function should return either BOOL_T
or BOOL_F
.
C function of one optional argument. If the optional argument is not
present, UNDEFINED
is passed in its place.
C function of 1 required and 1 optional argument. If the optional
argument is not present, UNDEFINED
is passed in its place.
C function of 2 arguments and a list of (rest of) SCM
arguments.
C function of list of SCM
arguments.
Next: Defining Subrs, Previous: Header Cells, Up: Data Types [Contents][Index]