Next: , Previous: Converting data between C and Scheme, Up: GH


5.22.10 Type predicates

These C functions mirror Scheme's type predicate procedures with one important difference. The C routines return C boolean values (0 and 1) instead of SCM_BOOL_T and SCM_BOOL_F.

The Scheme notational convention of putting a ? at the end of predicate procedure names is mirrored in C by placing _p at the end of the procedure. For example, (pair? ...) maps to gh_pair_p(...).

— Function: int gh_boolean_p (SCM val)

Returns 1 if val is a boolean, 0 otherwise.

— Function: int gh_symbol_p (SCM val)

Returns 1 if val is a symbol, 0 otherwise.

— Function: int gh_char_p (SCM val)

Returns 1 if val is a char, 0 otherwise.

— Function: int gh_vector_p (SCM val)

Returns 1 if val is a vector, 0 otherwise.

— Function: int gh_pair_p (SCM val)

Returns 1 if val is a pair, 0 otherwise.

— Function: int gh_procedure_p (SCM val)

Returns 1 if val is a procedure, 0 otherwise.

— Function: int gh_list_p (SCM val)

Returns 1 if val is a list, 0 otherwise.

— Function: int gh_inexact_p (SCM val)

Returns 1 if val is an inexact number, 0 otherwise.

— Function: int gh_exact_p (SCM val)

Returns 1 if val is an exact number, 0 otherwise.