Closed abhillman closed 9 months ago
We can check for square brackets and we already check for else clauses in cond
:
$ cat test.rkt
#lang racket/base
(cond
[1 2])
$ raco review test.rkt
test.rkt:3:1:warning:this cond expression does not have an else clause
But we can't check for clauses like in your example, because they could be valid. For example:
$ cat test.rkt
#lang racket/base
(define thing "hi")
(displayln
(cond
[thing]))
$ racket test.rkt
hi
This could be quite handy; i.e.
... where there is a warning here about not having an
else
clause. Currently, a warning aboutelse
clauses is only raised if there are no trailing expressions.