このスキームコードがわかりません。助けてください。Compute-frequenciesは、looking-for-listとpool-listの2つの別々のリストを取ります。これは、looking-for-listのすべてがpool-listにある回数を示すリストを返すことになっています。プールリストを通過した後の再帰呼び出しに関係している可能性が最も高いのは、ほんの少しのエラーです。
(define (compute-frequencies looking-for-list pool-list)
(define (helper looking-for-list pool-list current-frequency frequency-list) ; keeps track of finished list and iterates through both lists
(if (null? looking-for-list) (reverse frequency-list) ; finding the number of times data in looking-for-list are in pool-list
(if (null? pool-list)
(helper (cdr looking-for-list) pool-list 0 (cons current-frequency frequency-list))
(if (equal? (car looking-for-list) (car pool-list))
(helper looking-for-list (cdr pool-list) (+ 1 current-frequency) frequency-list)
(helper looking-for-list (cdr pool-list) current-frequency frequency-list)))))
(helper looking-for-list pool-list 0 '() ))