我使用DrRacket。我有這個代碼的問題:計劃的「預計可應用於參數的程序」
(define (qweqwe n) (
(cond
[(< n 10) #t]
[(>= (lastnum n) (pochtilastnum n)) (qweqwe (quotient n 10))]
[else #f]
)
)
)
(define (RTY file1 file2)
(define out (open-output-file file2 #:mode 'text #:exists 'replace))
(define in (open-input-file file1))
(define (printtofile q) (begin
(write q out)
(display '#\newline out)
))
(define (next)
(define n (read in))
(cond
[(equal? n eof) #t]
[else (begin
((if (qweqwe n) (printtofile n) #f))
) (next)]
)
)
(next)
(close-input-port in)
(close-output-port out))
但是當我開始(RTY 「in.txt」 「out.txt」)我有((如果(qweqwe N)(printtofile N)#f的錯誤) ):
application: not a procedure;
expected a procedure that can be applied to arguments
given: #f
arguments...: [none]
什麼問題?
地址:我changedmy代碼:
(cond
[(equal? n eof) #t]
[else
(if (qweqwe n) (printtofile n) #f)
(next)]
)
但問題仍然存在。
朋友,得到一些代碼格式化技能或張貼代碼之前使用「untabify」在編輯器中。 – GoZoner 2013-05-08 15:44:07
@ user23791查看我更新的答案 – 2013-05-08 20:31:42