Skip to content

Commit 8e83b1a

Browse files
Fix 2 occurrences of if-begin-to-cond
Using `cond` instead of `if` here makes `begin` unnecessary
1 parent 489f8c9 commit 8e83b1a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

typed-racket-lib/typed-racket/typecheck/tc-expr-unit.rkt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,11 @@
317317
(attribute opt.value))
318318
(opt-convert fun-type required-pos optional-pos optional-supplied?)]
319319
[_ #f]))
320-
(if conv-type
321-
(begin (tc-expr/check/type #'fun conv-type) (fix-results expected))
322-
(tc-expr/check form #f))]
320+
(cond
321+
[conv-type
322+
(tc-expr/check/type #'fun conv-type)
323+
(fix-results expected)]
324+
[else (tc-expr/check form #f)])]
323325
[(~and _:kw-lambda^
324326
(let-values ([(f) fun])
325327
(let-values _

typed-racket-test/external/tr-random-testing.rkt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@
337337
)))
338338
(or both-failed?
339339
(and (not racket-failed?)
340-
(if (same-result? racket-result racketbc-result)
341-
#t
342-
(begin (printf "not same as bc: racketcs: ~s racketbc: ~s\n"
343-
racket-result racketbc-result)
344-
#f)))))
340+
(cond
341+
[(same-result? racket-result racketbc-result) #t]
342+
[else
343+
(printf "not same as bc: racketcs: ~s racketbc: ~s\n" racket-result racketbc-result)
344+
#f]))))
345345

346346
(define num-exceptions 0)
347347

0 commit comments

Comments
 (0)