manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7.2.2 List Predicates

Often it is useful to test whether a given Scheme object is a list or not. List-processing procedures could use this information to test whether their input is valid, or they could do different things depending on the datatype of their arguments.

Scheme Procedure: list? x
C Function: scm_list_p (x)

Return #t if x is a proper list, else #f.

The predicate null? is often used in list-processing code to tell whether a given list has run out of elements. That is, a loop somehow deals with the elements of a list until the list satisfies null?. Then, the algorithm terminates.

Scheme Procedure: null? x
C Function: scm_null_p (x)

Return #t if x is the empty list, else #f.

C Function: int scm_is_null (SCM x)

Return 1 when x is the empty list; otherwise return 0.


This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.