From e8ec03112c1ec7eb22d4e091172e23cc239448e0 Mon Sep 17 00:00:00 2001 From: David Florness Date: Sat, 7 Mar 2020 14:53:37 -0700 Subject: [PATCH] Better output for some repl commands --- bulletin.rkt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bulletin.rkt b/bulletin.rkt index 723c414..6ba9949 100644 --- a/bulletin.rkt +++ b/bulletin.rkt @@ -226,21 +226,27 @@ election (λ (l) (cons cand l))))] + [(? eof-object?) (displayln "add what? options are `cand'")] [else (displayln "cannot add that")])] ['list (match (read sp) ['cands - (displayln (hash-ref election->candidates election))] + (println (hash-ref election->candidates election))] ['peers - (displayln (hash-values _peers))] + (println (hash-values _peers))] ['elections (displayln (format "current: ~a" election)) - (displayln (hash-keys election->candidates))])] + (println (hash-keys election->candidates))] + [(? eof-object?) + (displayln "list what? options are `cands' `peers' `elections'")] + [else (displayln "cannot list that")])] ['set (match (read sp) ['election (let* ([election (read sp)] [election (if (string? election) (string->symbol election) election)]) (election-set! election))] + [(? eof-object?) + (displayln "set what? options are `election'")] [else (displayln "cannot set that")])] ['open (if (memq state '(closed registering)) -- 2.38.4