Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が手続きする場合、例:
(define square (lambda (n) (* n n)))
たとえば、(square 5) を使用してテストします。この結果を Gambit Scheme インタプリタからテキスト ファイルにパイプするにはどうすればよいですか?
1 つの解決策:
(define square (lambda (n) (* n n))) (call-with-output-file "a-file.txt" (lambda () (display (square 5)) (newline)))
もう 1 つは、標準出力に直接出力する方法です。
(define square (lambda (n) (* n n))) (display (square 5)) (newline)
次に>、シェルで使用して、出力を特定のファイルに送信します。
>