私はlos、数字を取り、リストのnum番目のシンボルを返す関数検索を行いました。単純
(define (search los num)
(cond
[(empty? los) empty]
[(zero? num) (first los)]
[else (lookup (rest los) (- num 1))]))
(check-expect (lookup (list 'a 'b 'c 'd) 0) 'a)
しかし、 los (シンボルのリスト) 、シンボル (s) 、および数値 (numth) を取り、 num 番目のシンボルを s に置き換えて los を返す関数を設計する方法を理解するのに苦労しています。
このような何かのように-
(change (list 'a 'b 'c 'd) 'hello 2) ;==> (list 'a 'b 'hello 'd)
(change (list 'a 'b 'c 'd) 'hi 0) ;==> (list 'hi 'b 'c 'd)