コード圧縮
Posted feedbacks - Common Lisp
readで読んで、writeでプリティプリント属性をオフにして印字してみています。
入力ファイル:
;;; doukaku-189.data -*- lisp -*-
;; 1
(let ((x 10 )
(y 20 ))
(list x y ))
;; 2
(let ((x 10)
(y 20))
(list x y ))
~~
印字結果:
(LET ((X 10) (Y 20)) (LIST X Y))(LET ((X 10) (Y 20)) (LIST X Y))
入力ファイル:
;;; doukaku-189.data -*- lisp -*-
;; 1
(let ((x 10 )
(y 20 ))
(list x y ))
;; 2
(let ((x 10)
(y 20))
(list x y ))
~~
印字結果:
(LET ((X 10) (Y 20)) (LIST X Y))(LET ((X 10) (Y 20)) (LIST X Y))
1 2 3 | (with-open-file (str "doukaku-189.data")
(loop :for in := (read str nil nil) :while in
:do (write in :pretty nil)))
|


sweetie089 #6664() Rating-6/10=-0.60
[ reply ]