I am trying to evaluate a formula in scheme:
(define formula '(if (or (equal? '?country 'United-States) (equal? '?country 'England))
#t
#f))
(define (eval-formula formula)
(eval `(let ([?country 'United-States])
(display formula) (newline)
(display ?country) (newline)
,formula)))
(eval-formula formula)
reading http://docs.racket-lang.org/guide/eval.html that should return #t but when I run it, it returns #f. Could you please tell me what I misunderstood?
I tried also:
(define formula '(if (or (equal? '?country 'United-States) (equal? '?country 'England))
#t
#f))
(define ?country 'United-States)
(eval formula)
but I got the same result.
Many thanks!