Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define-presentation-type password () :inherit-from '((string) :description "password"))
- (define-presentation-method present (password (type password) stream (view textual-view) &key acceptably)
- (when acceptably (error "Not acceptably"))
- (write-string (make-string (length password) :initial-element #\*) stream))
- (define-presentation-method accept ((type password) stream (view textual-view) &key)
- (let* ((start (stream-scan-pointer stream))
- (passwd (with-output-recording-options (stream :draw nil :record nil)
- (read-token stream))))
- (presentation-replace-input stream passwd 'password view :buffer-start start)
- (return-from accept passwd)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement