Created
September 14, 2013 12:36
-
-
Save pocket7878/6561697 to your computer and use it in GitHub Desktop.
Shibuya.Lisp Meetup8のライブコーディングを僕もやってみた。
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
(load "~/quicklisp/setup.lisp") | |
(let* ((*standard-output* (make-broadcast-stream)) | |
(*error-output* *standard-output*)) | |
(ql:quickload :split-sequence)) | |
(defun parse-ls-l () | |
;;Throught first line | |
(read-line) | |
(loop for line = (read-line t nil nil) | |
while line | |
for words = (remove "" | |
(split-sequence:split-sequence #\Space line)) | |
for sec = (parse-integer (nth 1 words)) | |
for fiv = (parse-integer (nth 4 words)) | |
if (zerop (mod sec 2)) | |
sum fiv into even | |
else | |
sum fiv into odd | |
finally (return (values even odd)))) | |
(multiple-value-bind (e o) (parse-ls-l) | |
(format t "Even: ~A~% Odd: ~A~%" e o)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment