(define pick
(lambda (num lat)
(cond ((null? lat) (quote()))
((= (sub1 num) 0) (car lat))
(else
(pick (sub1 num) (cdr lat))))))
(define brees (quote (a b c d e touchdown g h i)))
(pick 6 brees)
The language in DrRacket is set to Advanced Student. It also works fine in the IronScheme console after defining sub1
.
The error message is:
reference to undefined identifier: R