Next: Procedure Names Up: Procedures Previous: Arity

## Primitives

A primitive procedure is a built-in procedure that is implemented in low-level language. Not all built-in procedures (see section 9.3.1) are primitives, but almost all R5RS procedures are primitives, as are most of the procedures described in this manual (except for MzLib procedures).

- `(primitive? v)` returns `#t` if v is a primitive procedure or `#f` otherwise.
- `(primitive-name prim-proc)` returns the name of the primitive procedure prim-proc as a string.
- `(primitive-result-arity prim-proc)` returns the arity of the result of the primitive procedure prim-proc (as opposed to the procedure's input arity as returned by `arity`; see section 4.10.1). For most primitives, this procedure returns `1` since most primitives return a single value when applied. For information about arity values, see section 4.10.1.
- `(primitive-closure? v)` returns `#t` if v is internally implemented as a primitive closure rather than an simple primitive procedure, `#f` otherwise. This information is intended for use by the `mzc` compiler.
- `(simple-return-primitive? prim-proc)` returns `#t` if the given primitive procedure never computes its return value by an internal chained tail call. This information is intended for use by the `mzc` compiler.