Scheme 对以前的结果应用程序

Scheme 对以前的结果应用程序,scheme,Scheme,给定一个列表列表作为输入,我希望执行一个过程,以便最终结果为: (define (thing . lists) ; list of lists (l1 l2 ... lN) ;returns ...f(f(f(l1 l2) l3) lN)... ) 例如: (thing '(a b) '(c d) '(e f)) (define f append) (thing '(a b) '(c d) '(e f)) => '(a b c d e f) …将导致f(f((a b)(c d))

给定一个列表列表作为输入,我希望执行一个过程,以便最终结果为:

(define (thing . lists) ; list of lists (l1 l2 ... lN)
  ;returns ...f(f(f(l1 l2) l3) lN)...
)
例如:

(thing '(a b) '(c d) '(e f))
(define f append)
(thing '(a b) '(c d) '(e f))
=> '(a b c d e f)
…将导致
f(f((a b)(c d))(e f))


我正在与折叠、lambda、apply和map进行斗争,但我无法找到正确的方法。

假设输入至少有两个列表,并且先前定义了
f

(define (thing . lists)
  (foldr (lambda (lst acc)
           (f acc lst))
         (f (car lists) (cadr lists))
         (cddr lists)))
例如:

(thing '(a b) '(c d) '(e f))
(define f append)
(thing '(a b) '(c d) '(e f))
=> '(a b c d e f)

你能提供一个你想应用的
f()
的例子吗?