Authentication

This commit is contained in:
2026-08-13 21:53:46 +02:00
parent 9f2e4b2bcc
commit c0bfc3485b
6 changed files with 109 additions and 51 deletions
+18 -1
View File
@@ -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