0

我是一个新的阴谋家。也许这个问题很简单。但这真的让我很困扰。

我定义了一个程序

(define insertL
    (lambda (new old lat)
      (cond
        ((null? lat) '())
        ((eq? old (car lat)) (cons new lat))
        (else (cons (car lat) (insertL (cdr lat)))))))

然后我称之为

> (insertL 2 3 '(1 2 3))

发生异常

Exception: incorrect number of arguments to #<procedure insertL>

为什么?

4

1 回答 1

0

需要多少参数insertL?您是否在调用它的两个地方都使用正确数量的参数来调用它?

于 2021-01-14T06:34:41.920 回答