[racket] TLS "atom?" definition for Scheme does not work in DrRacket

From: Rufus (rlaggren at mail.com)
Date: Tue Mar 3 15:16:26 EST 2015

On page 10 of TLS there is a note defining the "atom?" function for the
reader to use w/Lisp or Scheme. The definition for Scheme (which is the
most likely one to use for DrR) does not work. To fix one must remove
the parens that open at the "and". Apparently the DrR
compiler/interpreter sees them as an attempt to invoke a function and
that's not correct here. I don't know if other Lisp versions would find
the code in the book correct.

In the text below XXX shows where I removed a set of parens to make the
function work.

(define atom? (lambda (arg1)
               XXX and (not (pair? arg1))
                       (not (null? arg1))


Posted on the users mailing list.