Authentication
This commit is contained in:
+18
-1
@@ -6,6 +6,24 @@
|
||||
valid-http-or-file-url?
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; goal : Ask the user for input .
|
||||
; pre : p is a prompt.
|
||||
; post : It should give back the supplied input as string.
|
||||
; result : the return value of until.
|
||||
; internals:
|
||||
;
|
||||
; input-prompt displays the given prompt and reads a line
|
||||
; of text. After the user presses enter, this line is
|
||||
; fed to the until callback. If the until callback returns
|
||||
; #f, the prompt is displayed again. Otherwise, the value
|
||||
; of until is returned.
|
||||
;
|
||||
; The programmer must make sure the until returns whatever
|
||||
; format is appropriate. In general it will be a string.
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define (input-prompt p #:loop-until [until (λ (x) x)])
|
||||
(let loop ()
|
||||
(display p)
|
||||
@@ -20,7 +38,6 @@
|
||||
)
|
||||
|
||||
|
||||
|
||||
(define (valid-http-or-file-url? value)
|
||||
(if (not (string? value))
|
||||
#f
|
||||
|
||||
Reference in New Issue
Block a user