我想将以下代码合并为一个:
(define (foundList x)
(when (pair? x)
((hash-ref *function-table* (car x)) (cdr x))))
(define (endofstring x)
(if (not (null?(cdr x)))
(endofstring (cdr x))
(foundList (car x))))
我试图做以下但是我得到" hash-ref:找不到键值#34;
(define (endofstring x)
(if (not (null?(cdr x)))
(endofstring (cdr x))
(if (when (pair? x)
((hash-ref *function-table* (car x)) (cdr x)))
(car x) (void))))
需要帮助thanx
答案 0 :(得分:1)
我认为x
中的endofstring
与x
中的foundList
混淆了(foundList (car x))
。
将foundList
替换为x
的正文,并将(car x)
替换为(when (pair? (car x))
((hash-ref *function-table* (car (car x))) (cdr (car x))))
。
也就是说,用
(define (endofstring x)
(if (not (null?(cdr x)))
(endofstring (cdr x))
(when (pair? (car x))
((hash-ref *function-table* (car (car x))) (cdr (car x))))))
你得到了
git checkout orphan
git merge --no-commit --squash master
git commit