The Grinnell Scheme Web: The null?
procedure

Are there any procedures that operate specifically on the empty list?

There's the type predicate null?, which takes one argument and determines whether its operand is the empty list, returning the true Boolean value if it is and the false one if it is not:

> (null? '())
#t
> (null? '(3))
#f
> (null? (cons 1 2))
#f
> (null? (cdr '(3)))
#t
> (null? (cdr (cons 3 '())))
#t
In addition, there are a number of procedures that operate on lists, and most of them accept the empty list as an argument.


Next topic
Previous topic
Table of contents


This document is available on the World Wide Web as

http://www.math.grin.edu/~stone/scheme-web/null-ques.html


created August 11, 1995
last revised December 30, 1995

Copyright 1995 by John David Stone (stone@math.grin.edu)