figured out how to use keywords to create files

main
m455 2018-03-14 10:45:05 -04:00
parent ae2b6ae9a8
commit 7cdd820138
1 changed files with 19 additions and 12 deletions

View File

@ -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