我使用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