Last active
August 29, 2015 14:02
-
-
Save guicho271828/e969c37408cf45cf8594 to your computer and use it in GitHub Desktop.
sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; CIM 側のスクリプト。ユーザは操作することはできない。ただし、restart APIはある。 | |
(let ((*standard-output* (open (pop files)...))) | |
(restart-bind ((next-file (lambda (c) | |
(setf *standard-output* (open (pop files) ...))))) | |
(main))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cl -i .old -- X.lisp file1 file2 file3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; X.lisp | |
;; outfile のはじめに現在時間を付け加えるだけのスクリプト | |
(defparameter now (get-universal-time)) | |
;; <- 一回だけ評価されるようにしたい。すべてのファイルで同じようにしたい。 | |
;; ファイルごとに複数回評価されると、ファイルごとに追加される時間が異なってしまう。 | |
(tagbody | |
start | |
(handler-bind ((eof-error (lambda (c) (invoke-restart 'next-file) | |
(go 'start)))) | |
(print now *standard-output*) ;; <- outfile のはじめに現在時間を付け加える | |
(loop | |
(write-char *standard-output* (read-char *standard-input*))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment