-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt-value.lisp
37 lines (34 loc) · 1.47 KB
/
prompt-value.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
;; THE LICENSE THAT'S NOT A LICENSE
;; Version 1.618, January 2017
;;
;; Redistribution of this LICENSE is permitted, either in unmodified
;; form, with no further qualifications, or in modified form,
;; under the condition that the name of the license is changed.
;;
;; THE LICENSE THAT'S NOT A LICENSE
;; TERMS AND CONDITIONS FOR USAGE, COPYING, DISTRIBUTION, AND MODIFICATION
;; OF PROVIDED SOFTWARE
;;
;;
;; 1. Do WHATEVER YOU WANT with the provided software.
;; 2. Credit is appreciated, but not required.
;;
;;
;; This software is provided with NO WARRANTY, implied or otherwise.
;;;;
;;;; TRIVIAL-ESCAPES
;;;; William Yao, <[email protected]>
;;;; Copyright (c) 2017
;;;;
(in-package #:trivial-escapes)
(defun prompt-value (&optional
(input-stream *query-io*)
(output-stream *query-io*)
(prompt "Enter a value to use:")
(eof-error-p t)
(eof-value nil)
(recursive-p nil))
"Primarily meant to be used in interactive restarts.
PROMPT doesn't require a trailing space."
(format output-stream "~A " prompt)
(read-line input-stream eof-error-p eof-value recursive-p))