[plt-scheme] atom?

From: Pierpaolo BERNARDI (bernardp at cli.di.unipi.it)
Date: Wed Jan 11 14:01:37 EST 2006

On Wed, 11 Jan 2006 17:54:50 +0100, Jens Axel Søgaard <jensaxel at soegaard.net> wrote:

> I just fell over this in (lib "compat.ss")
>
>    (atom? v)      PROCEDURE
>    Same as (not (pair? v)).

> Wouldn't
>
> (define (atom? o)
>    (or (void? o)
>        (boolean? o)
>        (number? 0)
>        (char? o)
>        (symbol? o)
>        (keyword? o)
>        (null? o)))
>
> be better?

No. The first definition is what ATOM{P|?} means in every lisp implementation since lisp 1.5 (and maybe before)

P.



Posted on the users mailing list.