lambdabot

Untitled

Jan 20th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.42 KB | None | 0 0
  1. (defun punctuation-p (char) (find char "[!,?.\_'@]+"))
  2.  
  3. (defun read-line-no-punct ()
  4.   "Read an input line, ignoring punctuation."
  5.   (read-from-string
  6.     (concatenate 'string "(" (substitute-if #\space #'punctuation-p
  7.                                             (read-line))
  8.                  ")")))
  9.  
  10. (defun print-lines (lst)
  11.   (format t "~d ~%~{~:(~a~)~%~}" (length lst) lst))
  12.  
  13. (print-lines (read-line-no-punct))
Advertisement
Add Comment
Please, Sign In to add comment