Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. (defun count-spaces-in-lines (pathname)
  2. (with-open-file (stream pathname)
  3. (loop :for line := (read-line stream nil)
  4. :while line
  5. :collect (count-if (lambda (ch) (find ch #(#\space #\tab))) line))))
  6. (count-spaces-in-lines "/etc/passwd")
  7. --> (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