DrRacket atom? character ?: undefined? What's wrong?

Im learning to program lips using drift. I do not really like this, but I would like to pass the exam;)

I have a strange problem - can't I use an atom? and symbol? functions. But the number? and sting? works great.

> (atom? '())
. . atom?: undefined;
 cannot reference an identifier before its definition
> (symbol? A)
. . A: undefined;
 cannot reference an identifier before its definition
> 

Am I doing it wrong? Or what is the problem? Im using DrRacket 6.0.1 on Mac

early

+4
source share
1 answer

For the first error: you must explicitly determine atom?, because there is no built-in procedure in a simple Racket (perhaps this is in one of the training languages):

(define (atom? x)
  (and (not (null? x))
       (not (pair? x))))

: symbol? , , A - undefined. , ( ):

(symbol? 'A)
=> #t
+8

Source: https://habr.com/ru/post/1544240/


All Articles