Advertisement
Guest User

Untitled

a guest
Mar 4th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.68 KB | None | 0 0
  1. (define-presentation-type password () :inherit-from '((string) :description "password"))
  2.  
  3. (define-presentation-method present (password (type password) stream (view textual-view) &key acceptably)
  4.   (when acceptably (error "Not acceptably"))
  5.   (write-string (make-string (length password) :initial-element #\*) stream))
  6.  
  7. (define-presentation-method accept ((type password) stream (view textual-view) &key)
  8.   (let* ((start (stream-scan-pointer stream))
  9.          (passwd (with-output-recording-options (stream :draw nil :record nil)
  10.                    (read-token stream))))
  11.     (presentation-replace-input stream passwd 'password view :buffer-start start)
  12.     (return-from accept passwd)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement