Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun count-spaces-in-lines (pathname)
- (with-open-file (stream pathname)
- (loop :for line := (read-line stream nil)
- :while line
- :collect (count-if (lambda (ch) (find ch #(#\space #\tab))) line))))
- (count-spaces-in-lines "/etc/passwd")
- --> (0 2 1 13 12 2 0 9 2 0 1 1 1 4 2 1 1 1 2 2 2 3 1 1 2 1 0 0 2 3 2 1 1 1 2 2 1 2 1 1 1 2 1 0 0 1 0 0 0 1 0 1 1 1 2 2 0 1 2 0 2 1 3 1 1 1 3 2 3 2 2 0 1 1 2 3 5 4 5 2 3 2 3 0 0 0 1 1 2 1 2 2 1 3 3 1 1 3 0 0 1 1 2 3 1 1 2 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement