Skip to content

Commit a51e0f3

Browse files
Fix 1 occurrence of let-to-define
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
1 parent c9d12e3 commit a51e0f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

typed-racket-lib/typed-racket/typed-reader.rkt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
(define ch (peek-char port))
1212
(unless (eof-object? ch)
1313
;; Consult current readtable:
14-
(let-values ([(like-ch/sym proc dispatch-proc) (readtable-mapping (current-readtable) ch)])
15-
;; If like-ch/sym is whitespace, then ch is whitespace
16-
(when (and (char? like-ch/sym) (char-whitespace? like-ch/sym))
17-
(read-char port)
18-
(skip-whitespace port)))))
14+
(define-values (like-ch/sym proc dispatch-proc) (readtable-mapping (current-readtable) ch))
15+
;; If like-ch/sym is whitespace, then ch is whitespace
16+
(when (and (char? like-ch/sym) (char-whitespace? like-ch/sym))
17+
(read-char port)
18+
(skip-whitespace port))))
1919

2020
(define (skip-comments read-one port src)
2121
;; Recursive read, but skip comments and detect EOF

0 commit comments

Comments
 (0)