0
我想創建一個使用下面的定義序列:生成方案序列
(define f1 (lambda (x) #t))
(define f2 (lambda (x) #f))
(define f3 (lambda (x) (if (null? x) #t (car x))))
(define f4 (lambda (x) (if (null? x) #t (not (car x)))))
我的代碼如下:
(define (generate func n)
(let ((mylist '()))
(if (= n 0) mylist
(cons (func mylist) (generate func (- n 1)))
)))
它的伎倆,對於F1 F2和F3,但是當我嘗試f4就像(生成f4 10)它生成的 (#t #t #t #t #t #t #t #t #t #t)而不是(#t #f #t #f #t #f# t #f #t #f)。
感謝您的任何幫助。
感謝您的提示。 –