Skip to content

Commit 69f11b7

Browse files
Fix 2 occurrences of let-to-define
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
1 parent 6d32016 commit 69f11b7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

typed-racket-lib/typed-racket/rep/object-rep.rkt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@
268268
[(list (? exact-integer? coeff) (? Path? p))
269269
(values c (terms-set ts p (+ coeff (terms-ref ts p))))]
270270
[(list (? exact-integer? coeff) (? name-ref/c nm))
271-
(let ([p (-id-path nm)])
272-
(if (Empty? nm)
273-
(values c ts)
274-
(values c (terms-set ts p (+ coeff (terms-ref ts p))))))]
271+
(define p (-id-path nm))
272+
(if (Empty? nm)
273+
(values c ts)
274+
(values c (terms-set ts p (+ coeff (terms-ref ts p)))))]
275275
[(? exact-integer? new-const)
276276
(values (+ new-const c) ts)]
277277
[(LExp: c* ts*)

typed-racket-lib/typed-racket/rep/type-rep.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,8 @@
11551155
(match ts
11561156
[(list) (-refine Univ prop)]
11571157
[(list t) (-refine t prop)]
1158-
[_ (let ([t (make-Intersection ts -tt elems)])
1159-
(-refine t prop))])]
1158+
[_ (define t (make-Intersection ts -tt elems))
1159+
(-refine t prop)])]
11601160
[(cons arg args)
11611161
(match arg
11621162
[(Univ:) (loop ts elems prop args)]

0 commit comments

Comments
 (0)