0

リスト内の重複を削除して新しいリストを返す関数 remove_duplicates があります。

(define (remove_duplicate list)
(cond
    ((null? list) '() )

    ;member? returns #t if the element is in the list and #f otherwise
    ((member? (car list) (cdr list)) (remove_duplicate(cdr list)))

    (else (cons (car list) (remove_duplicate (cdr list))))

))

この関数呼び出しからの戻り値を、別の関数 f の変数に代入したいと考えています。

(define (f list)
    ;I have tried this syntax and various other things without getting the results I would like
    (let* (list) (remove_duplicates list))
)

どんな助けでも大歓迎です、ありがとう!

4

1 に答える 1