From 15709187f709781d4c082cacb181002ffbeba7a0 Mon Sep 17 00:00:00 2001 From: m455 Date: Wed, 10 Oct 2018 14:42:13 -0400 Subject: [PATCH] prefixed init.rkt --- init.rkt | 57 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/init.rkt b/init.rkt index 4da065d..0b1627f 100644 --- a/init.rkt +++ b/init.rkt @@ -1,46 +1,45 @@ #lang racket/base -(require racket/file - "config.rkt" - "util.rkt" - "messages.rkt") +(require (prefix-in file: racket/file) + (prefix-in config: "config.rkt") + (prefix-in util: "util.rkt") + (prefix-in messages: "messages.rkt")) (provide (all-defined-out)) (define (initialize-file) - (display-to-file - "--Do not edit this file--\n" - path - #:mode 'text - #:exists 'replace)) + (file:display-to-file + "--Do not edit this file--\n" + config:path + #:mode 'text + #:exists 'replace)) (define (init-prompt hash-list key) - (display-hash-ref hash-list key) + (util:display-hash-ref hash-list key) (display "> ") (let - ([user-input (read-line)]) + ([user-input (read-line)]) (cond - [(member user-input (hash-ref y/n 'yes)) - (display-hash-ref messages 'creating-folder) - (display-hash-ref messages 'creating-file) - (create-folder) - (create-file) + [(member user-input (hash-ref messages:y/n 'yes)) + (util:display-hash-ref messages:messages 'creating-folder) + (util:display-hash-ref messages:messages 'creating-file) + (util:create-folder) + (util:create-file) (initialize-file) - (if - (and - (check-for-folder) - (check-for-file)) - (display-hash-ref messages 'successfully-created) - (display-hash-ref messages 'creation-error))] + (if (and + (util:check-for-folder) + (util:check-for-file)) + (util:display-hash-ref messages:messages 'successfully-created) + (util:display-hash-ref messages:messages 'creation-error))] - [(member user-input (hash-ref y/n 'no)) - (display-hash-ref messages 'terminating)] + [(member user-input (hash-ref messages:y/n 'no)) + (util:display-hash-ref messages:messages 'terminating)] [else - (init-prompt messages 'choose-y/n)]))) + (init-prompt messages:messages 'choose-y/n)]))) (define (initialize) - (if (check-for-file) - (display-hash-ref messages 'file-already-exists) - (begin - (init-prompt messages 'init-y/n)))) + (if (util:check-for-file) + (util:display-hash-ref messages:messages 'file-already-exists) + (begin + (init-prompt messages:messages 'init-y/n))))