From 22cecf9a11f68d4831ed0939f50ef2149fa3df0e Mon Sep 17 00:00:00 2001 From: m455 Date: Sat, 28 Apr 2018 09:31:39 -0400 Subject: [PATCH] changed two lets into one let --- util.rkt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/util.rkt b/util.rkt index a15a86d..4c26434 100644 --- a/util.rkt +++ b/util.rkt @@ -28,11 +28,11 @@ (empty? (rest (file->string-list lst)))) (define (get-removed-item lst args) - (list-ref lst (string->number args))) + (list-ref lst (string->number args))) (define (quote-item args) (display - (string-append "\"" args "\""))) + (string-append "\"" args "\""))) (define (number-list lst) (map string-append @@ -74,9 +74,9 @@ path #:mode 'text #:exists 'replace) - (d-hash-ref messages 'item-added-prefix) - (quote-item args) - (d-hash-ref messages 'item-added-suffix))) + (d-hash-ref messages 'item-added-prefix) + (quote-item args) + (d-hash-ref messages 'item-added-suffix))) (define (add-item args) (if @@ -90,16 +90,16 @@ (define (remove-item-from-file args) (let ([removed-item - (get-removed-item (file->string-list path) args)]) - (let ([new-list - (remove - (list-ref (file->string-list path) (string->number args)) - (file->string-list path))]) - (display-to-file - (string-join new-list "\n" #:after-last "\n") - path - #:mode 'text - #:exists 'replace)) + (get-removed-item (file->string-list path) args)] + [new-list + (remove + (list-ref (file->string-list path) (string->number args)) + (file->string-list path))]) + (display-to-file + (string-join new-list "\n" #:after-last "\n") + path + #:mode 'text + #:exists 'replace) (d-hash-ref messages 'item-removed-prefix) (quote-item removed-item) (d-hash-ref messages 'item-removed-suffix)))