made my hash list more readable
This commit is contained in:
parent
67960042d2
commit
099595600e
16
rodo.rkt
16
rodo.rkt
@ -62,24 +62,32 @@
|
|||||||
|
|
||||||
'terminating (string-append "> Exiting " program-name " ...\n")))
|
'terminating (string-append "> Exiting " program-name " ...\n")))
|
||||||
|
|
||||||
;; some possible user-input related "mistakes" that will be accepted for input
|
;; some possible user-input related "mistakes" that
|
||||||
|
;; will be accepted for input
|
||||||
(define y/n
|
(define y/n
|
||||||
(hash
|
(hash
|
||||||
'yes '("yes" "Yes" "y" "Y")
|
'yes '("yes" "Yes" "y" "Y")
|
||||||
'no '("no" "No" "n" "N")))
|
'no '("no" "No" "n" "N")))
|
||||||
|
|
||||||
(define (open/create-file list-name)
|
(define (open/create-file list-name)
|
||||||
(let ([path (expand-user-path (string-append program-path program-directory list-name))])
|
(let ([path (expand-user-path (string-append
|
||||||
|
program-path
|
||||||
|
program-directory
|
||||||
|
list-name))])
|
||||||
(let ([opened-file (open-output-file path
|
(let ([opened-file (open-output-file path
|
||||||
#:mode 'text
|
#:mode 'text
|
||||||
#:exists 'can-update)])
|
#:exists 'can-update)])
|
||||||
(close-output-port opened-file))))
|
(close-output-port opened-file))))
|
||||||
|
|
||||||
(define (create-folder)
|
(define (create-folder)
|
||||||
(make-directory (expand-user-path (string-append program-path program-directory))))
|
(make-directory (expand-user-path (string-append
|
||||||
|
program-path
|
||||||
|
program-directory))))
|
||||||
|
|
||||||
(define (check-for-folder)
|
(define (check-for-folder)
|
||||||
(directory-exists? (expand-user-path (string-append program-path program-directory))))
|
(directory-exists? (expand-user-path (string-append
|
||||||
|
program-path
|
||||||
|
program-directory))))
|
||||||
|
|
||||||
;; prompt user for file initial file creation
|
;; prompt user for file initial file creation
|
||||||
(define (prompt-user chosen-message)
|
(define (prompt-user chosen-message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user