Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/sbcl --script
- (defun stream-to-lines (stream)
- (let ((line (read-line stream nil)))
- (and line
- (cons line (stream-to-lines stream)))))
- (defun print-stream-reversed-order (stream &key (printer 'write-line))
- (mapcar printer (reverse (stream-to-lines stream))))
- (defun tac (filepath)
- (let ((stream (or (and filepath (open filepath))
- *standard-input*)))
- (print-stream-reversed-order stream)
- (close stream)))
- (tac (cadr *posix-argv*))
Add Comment
Please, Sign In to add comment