PPT Slide
1.42
Another One with Similar Form
Determine if there are any odd numbers in an
arbitrary list structure.
( defun any-odd ( x )
( cond
( ( null x ) nil)
( ( numberp x ) ( oddp x ) )
( T ( or
( any-odd ( first x ) )
( any-odd ( rest x ) ) ) )
) )
S
2
7
3
6
9
(any-odd S)
Is this efficient?
Previous slide
Next slide
Back to first slide
View graphic version