From fadbca3fd2acf1df0010c452273c3cdfb274a100 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 22 Jun 2018 10:57:46 -0700 Subject: [PATCH] use guard expr --- beautiful-racket-demo/funstacker-demo/funstacker.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beautiful-racket-demo/funstacker-demo/funstacker.rkt b/beautiful-racket-demo/funstacker-demo/funstacker.rkt index 487466f..23545ec 100644 --- a/beautiful-racket-demo/funstacker-demo/funstacker.rkt +++ b/beautiful-racket-demo/funstacker-demo/funstacker.rkt @@ -15,7 +15,8 @@ (define (handle-args . args) (for/fold ([stack-acc empty]) - ([arg (filter-not void? args)]) + ([arg (in-list args)] + #:unless (void? arg)) (cond [(number? arg) (cons arg stack-acc)] [(or (equal? * arg) (equal? + arg))