From a0a7645e160e13085c32167c0346b57b8ec9076d Mon Sep 17 00:00:00 2001 From: m455 Date: Thu, 16 Jul 2020 17:04:55 -0400 Subject: [PATCH] simplified pattern matching --- src/nicethings.rkt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/nicethings.rkt b/src/nicethings.rkt index ffd11c2..d077dd1 100644 --- a/src/nicethings.rkt +++ b/src/nicethings.rkt @@ -301,16 +301,14 @@ (format " ~a ~a 2" program-name rm-command)))) (define (process-args vectorof-args) - (define (args-ref number) - (vector-ref vectorof-args number)) (match vectorof-args [(or (vector (== help-command-1)) (vector (== help-command-2)) (vector (== help-command-3))) (help)] [(vector (== ls-command)) (ls)] [(vector (== init-command)) (init)] - [(vector (== add-command) _) (add (args-ref 1))] - [(vector (== rm-command) _) (rm (args-ref 1))] + [(vector (== add-command) a) (add a)] + [(vector (== rm-command) a) (rm a)] [(vector _ _ _ ...) (displayln-messages-ref 'error-too-many-arguments)] [(vector _ _)