Function TERPRI, FRESH-LINE
terpri &optional output-stream => nil
fresh-line &optional output-stream => generalized-boolean
output-stream - 出力ストリーム指定子。標準は標準出力。
generalized-boolean - generalized-boolean
terpriは、output-streamに改行newlineを出力します。
fresh-lineはterpriと似ていますが、 もしoutput-streamが行の始まりに位置していないときのみ 改行newlineを出力します。 何らかの理由でこのような状況が決定できないときは、 改行newlineは常に出力します。 fresh-lineは、改行newlineが出力されたときtrueを返却し、 それ以外のときはfalseを返却します。
(with-output-to-string (s)
(write-string "some text" s)
(terpri s)
(terpri s)
(write-string "more text" s))
=> "some text
more text"
(with-output-to-string (s)
(write-string "some text" s)
(fresh-line s)
(fresh-line s)
(write-string "more text" s))
=> "some text
more text"output-streamは修正されます。
*standard-output*, *terminal-io*
なし。
なし。
terpriの効果は下記の同等です。
(write-char #\Newline output-stream)