Fundamentals of CS I (CS151 2001S) : Reference

list? - determine if a value is a list

Parametersval, a value
PurposeDetermines if val is a list (and can therefore be used as a parameter to car and cdr).
ProducesA truth value: true (#t) if val is a list, false (#f) if it's not a list.
PreconditionsOnly one parameter (verified).
> (list? ())
> (list? (cons 'a null))
> (list? (list 'a 'b 'c))
> (list? 'a)
> (list? cons)
> (list? 'cons)
> (list? "cons")

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Thu Feb 22 05:48:04 2001.
This page may be found at
You may validate this page's HTML.
The source was last modified Fri Feb 2 06:34:48 2001.