I am working on an assignment in racket. It looks at a list, does a simple math calculation, then outputs the info from the list. Heres the function that does the outputting.
(define (report-open-seats list-of-courses)
(for/list ([e (in-list course-list)]
#:when (and (number? (list-ref e 4)) (number? (list-ref e 5))))
(displayln (open-seats e))))
The #:when is supposed to just make sure there's numbers where I'm expecting numbers. Open-seats returns a string. Here is my output.
CMSC201 (Section 1)=> 70
CMSC341 (Section 6)=> 13
CMSC331 (Section 5)=> 4
CMSC471 (Section 3)=> 9
'(#<void> #<void> #<void> #<void>)
How can I get rid of the junk # output? All I want is the first 4 lines of output not the 5th. I've noticed that if I change the code to this:
(displayln (open-seats e)))"")
It changes the output to:
CMSC201 (Section 1)=> 70
CMSC341 (Section 6)=> 13
CMSC331 (Section 5)=> 4
CMSC471 (Section 3)=> 9
""