Created
December 11, 2016 10:47
-
-
Save zeptometer/cd37ecaefb6305d3f2bdeb129593c252 to your computer and use it in GitHub Desktop.
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
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(defun script-p () | |
(eql sb-sys:*stdin* *standard-input*)) ) | |
(macrolet ((optimize (pred) | |
(if pred | |
`(declaim (optimize (speed 3) (debug 0) (safety 0))) | |
`(declaim (optimize (speed 0) (debug 3) (safety 3)))))) | |
(optimize #.(script-p))) | |
(defun xclip () | |
(with-output-to-string (s) | |
(sb-ext:run-program "/usr/bin/xclip" '("-o") :output s))) | |
(defun test () | |
(with-input-from-string (*standard-input* (xclip)) | |
(main))) | |
(defun main () | |
;; write something here | |
) | |
(when (script-p) (main)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment