figured out how to use keywords to create files
parent
ae2b6ae9a8
commit
7cdd820138
9
rodo.rkt
9
rodo.rkt
|
@ -16,13 +16,20 @@
|
|||
'yes '("yes" "Yes" "y" "Y")
|
||||
'no '("no" "No" "n" "N")))
|
||||
|
||||
(define (open/create-file path)
|
||||
(let ([path (expand-user-path path)])
|
||||
(open-output-file path
|
||||
#:mode 'text
|
||||
#:exists 'can-update)))
|
||||
|
||||
; just figuring out stuff here
|
||||
(define (prompt-user prompt-message)
|
||||
(display-hash message prompt-message)
|
||||
(let ([user-input (read-line)])
|
||||
(cond
|
||||
[(member user-input (hash-ref y-n 'yes))
|
||||
(displayln "You chose yes")]
|
||||
(displayln "You chose yes")
|
||||
(open/create-file "~/.rodo")]
|
||||
[(member user-input (hash-ref y-n 'no))
|
||||
(displayln "You chose no")]
|
||||
[else
|
||||
|
|
Loading…
Reference in New Issue