From: Ted Sandler
Subject: Re: Function clarification
Date: 
Message-ID: <3ADD1AA2.4E36CD2A@worldnet.att.net>
binaryfoo wrote:
> 
> Hi I'm going thru the book "ANSI Common Lisp", by Paul Graham.  In the first
> chapter there's an exercise 5-a on page 29.
> I've looked it over, it appears to be a recursive function but I haven't
> figured out what it does yet.  Here's the function:
> 
> (defun enigma (x)
>     (and (not (null x))
>             (or (null (car x))
>                   (enigma (cdr x))))
> When I tried to use the function, the interpreter would just spit out nil or
> error out.  I'm not sure what this thing's supposed to do.  It looks like
> it's checking to see if x is not null, or if it's a list of two elements,
> the elements aren't null?
> 
> Appreciate any insight on this.

You got it mostly right.  Put simply, this function returns true if the
list it's passed contains 'nil' as an element.  However, it'll crash if
you pass it something other than a list.


> 
> TIA
> -brandon

-- 
··········@att.net