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