From 2d1ef85209670859dfdc041c65fd201c5b9564e5 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Wed, 14 Oct 2020 00:07:08 +0200 Subject: [PATCH] networks: Streamline print-org-tbfs/state. --- networks.rkt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/networks.rkt b/networks.rkt index 6f9caff..f625e59 100644 --- a/networks.rkt +++ b/networks.rkt @@ -1146,15 +1146,13 @@ ;;; names of the variables, as well as the symbol 'θ to represent the ;;; column giving the thresholds of the TBF. (define (print-org-tbfs/state tbfs #:headers [headers #t]) - (define table (for/list ([tbf (in-list tbfs)]) (append (hash-map (tbf/state-w tbf) (λ (_ w) w) #t) (list (tbf/state-θ tbf))))) - (append - (if headers - (list (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ))) - (empty)) - table)) + (if headers + (cons (append (hash-map (tbf/state-w (car tbfs)) (λ (x _) x) #t) '(θ)) + table) + table)) (module+ test (test-case "print-org-tbfs/state"