From f5dda1adbf4d526ce4a80de49816971c1435d9b7 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:47 +0000 Subject: [PATCH 01/11] Fix 1 occurrence of `and-let-to-cond` Using `cond` allows converting `let` to internal definitions, reducing nesting --- scribble-text-lib/scribble/text/output.rkt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scribble-text-lib/scribble/text/output.rkt b/scribble-text-lib/scribble/text/output.rkt index d2480f4034..d72a65f439 100644 --- a/scribble-text-lib/scribble/text/output.rkt +++ b/scribble-text-lib/scribble/text/output.rkt @@ -57,11 +57,14 @@ 0)) ;; combines a prefix with a target column to get to (define (pfx+col pfx) - (and pfx (let ([col (getcol)]) - (cond [(number? pfx) (max pfx col)] - [(>= (string-length pfx) col) pfx] - [else (string-append - pfx (make-spaces (- col (string-length pfx))))])))) + (cond + [pfx + (define col (getcol)) + (cond + [(number? pfx) (max pfx col)] + [(>= (string-length pfx) col) pfx] + [else (string-append pfx (make-spaces (- col (string-length pfx))))])] + [else #f])) ;; adds two prefixes (define (pfx+ pfx1 pfx2) (and pfx1 pfx2 From 69c2b756dcb7c08bb7acb7ed9bd554be95152989 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 02/11] Fix 1 occurrence of `map-to-for` This `map` operation can be replaced with a `for/list` loop. --- scribble-lib/scribble/srcdoc.rkt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scribble-lib/scribble/srcdoc.rkt b/scribble-lib/scribble/srcdoc.rkt index 7143a61cc1..95b2be9d31 100644 --- a/scribble-lib/scribble/srcdoc.rkt +++ b/scribble-lib/scribble/srcdoc.rkt @@ -75,14 +75,13 @@ (syntax-shift-phase-level s #f))) (with-syntax ([((req ...) ...) (for/list ([rs (in-list (reverse requires))]) - (map (lambda (r) - (syntax-case r () - [(op arg ...) - (with-syntax ([(arg ...) (map shift-and-introduce - (syntax->list #'(arg ...)))]) - #'(op arg ...))] - [else (shift-and-introduce r)])) - (syntax->list rs)))] + (for/list ([r (in-list (syntax->list rs))]) + (syntax-case r () + [(op arg ...) + (with-syntax ([(arg ...) (map shift-and-introduce + (syntax->list #'(arg ...)))]) + #'(op arg ...))] + [else (shift-and-introduce r)])))] [(expr ...) (map shift-and-introduce (reverse doc-exprs))] [doc-body From 43dfdd4425d1a6e700ef702e4e5acb67c9af4d69 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 03/11] Fix 7 occurrences of `let-to-define` Internal definitions are recommended instead of `let` expressions, to reduce nesting. --- scribble-lib/scribble/srcdoc.rkt | 95 +++++++++-------- scribble-lib/scribble/xref.rkt | 136 ++++++++++++------------ scribble-test/tests/scribble/reader.rkt | 12 +-- 3 files changed, 125 insertions(+), 118 deletions(-) diff --git a/scribble-lib/scribble/srcdoc.rkt b/scribble-lib/scribble/srcdoc.rkt index 95b2be9d31..44e848c1e8 100644 --- a/scribble-lib/scribble/srcdoc.rkt +++ b/scribble-lib/scribble/srcdoc.rkt @@ -127,11 +127,12 @@ (let ([t (syntax-local-value #'id (lambda () #f))]) (unless (provide/doc-transformer? t) (raise-syntax-error #f "not bound as a provide/doc transformer" stx #'id)) - (let* ([i (make-syntax-introducer)] - [i2 (lambda (x) (syntax-local-introduce (i x)))]) - (let-values ([(p/c d req/d id) ((provide/doc-transformer-proc t) - (i (syntax-local-introduce form)))]) - (list (i2 p/c) (i req/d) (i d) (i id)))))] + (define i (make-syntax-introducer)) + (define (i2 x) + (syntax-local-introduce (i x))) + (let-values ([(p/c d req/d id) ((provide/doc-transformer-proc t) + (i (syntax-local-introduce form)))]) + (list (i2 p/c) (i req/d) (i d) (i id))))] [_ (raise-syntax-error #f "not a provide/doc sub-form" stx form)]))]) (with-syntax ([(p/c ...) (map (lambda (form f) @@ -344,44 +345,52 @@ (let ([build-mandatories/optionals (λ (names contracts extras) - (let ([names-length (length names)] - [contracts-length (length contracts)]) - (let loop ([contracts contracts] - [names names] - [extras extras]) - (cond - [(and (null? names) (null? contracts)) '()] - [(or (null? names) (null? contracts)) - (raise-syntax-error #f - (format "mismatched ~a argument list count and domain contract count (~a)" - (if extras "optional" "mandatory") - (if (null? names) - "ran out of names" - "ran out of contracts")) - stx)] - [else - (let ([fst-name (car names)] - [fst-ctc (car contracts)]) - (if (keyword? (syntax-e fst-ctc)) - (begin - (unless (pair? (cdr contracts)) - (raise-syntax-error #f - "keyword not followed by a contract" - stx)) - (cons (if extras - (list fst-ctc fst-name (cadr contracts) (car extras)) - (list fst-ctc fst-name (cadr contracts))) - (loop (cddr contracts) - (cdr names) - (if extras - (cdr extras) - extras)))) - (cons (if extras - (list fst-name fst-ctc (car extras)) - (list fst-name fst-ctc)) - (loop (cdr contracts) (cdr names) (if extras - (cdr extras) - extras)))))]))))]) + (define names-length (length names)) + (define contracts-length (length contracts)) + (let loop ([contracts contracts] + [names names] + [extras extras]) + (cond + [(and (null? names) (null? contracts)) '()] + [(or (null? names) (null? contracts)) + (raise-syntax-error + #f + (format + "mismatched ~a argument list count and domain contract count (~a)" + (if extras "optional" "mandatory") + (if (null? names) + "ran out of names" + "ran out of contracts")) + stx)] + [else + (let ([fst-name (car names)] + [fst-ctc (car contracts)]) + (if (keyword? (syntax-e fst-ctc)) + (begin + (unless (pair? (cdr contracts)) + (raise-syntax-error + #f + "keyword not followed by a contract" + stx)) + (cons (if extras + (list fst-ctc + fst-name + (cadr contracts) + (car extras)) + (list fst-ctc fst-name (cadr contracts))) + (loop (cddr contracts) + (cdr names) + (if extras + (cdr extras) + extras)))) + (cons (if extras + (list fst-name fst-ctc (car extras)) + (list fst-name fst-ctc)) + (loop (cdr contracts) + (cdr names) + (if extras + (cdr extras) + extras)))))])))]) #`([(id #,@(build-mandatories/optionals (syntax->list #'(mandatory-names ...)) (syntax->list #'(mandatory ...)) diff --git a/scribble-lib/scribble/xref.rkt b/scribble-lib/scribble/xref.rkt index 5177196e83..11f62f6437 100644 --- a/scribble-lib/scribble/xref.rkt +++ b/scribble-lib/scribble/xref.rkt @@ -55,21 +55,32 @@ (let* ([renderer (new render% [dest-dir (find-system-path 'temp-dir)])] [fp (send renderer traverse null null)] [load-source (lambda (src ci) - (parameterize ([current-namespace - (namespace-anchor->empty-namespace here)]) - (let ([vs (src)]) - (for ([v (in-list (if (procedure? vs) (vs) (list vs)))]) - (when v - (define data (if (data+root? v) (data+root-data v) v)) - (define root (if (data+root? v) (data+root-root v) root-path)) - (define doc-id (or (and (data+root+doc-id? v) (data+root+doc-id-doc-id v)) - doc-id-str)) - (define pkg (or (and (data+root+doc-id+pkg? v) (data+root+doc-id+pkg-pkg v)) - pkg-str)) - (send renderer deserialize-info data ci - #:root root - #:doc-id doc-id - #:pkg pkg))))))] + (parameterize ([current-namespace (namespace-anchor->empty-namespace here)]) + (define vs (src)) + (for ([v (in-list (if (procedure? vs) + (vs) + (list vs)))]) + (when v + (define data + (if (data+root? v) + (data+root-data v) + v)) + (define root + (if (data+root? v) + (data+root-root v) + root-path)) + (define doc-id + (or (and (data+root+doc-id? v) (data+root+doc-id-doc-id v)) + doc-id-str)) + (define pkg + (or (and (data+root+doc-id+pkg? v) (data+root+doc-id+pkg-pkg v)) + pkg-str)) + (send renderer deserialize-info + data + ci + #:root root + #:doc-id doc-id + #:pkg pkg)))))] [use-ids (make-weak-hasheq)] [ci (send renderer collect null null fp (lambda (key ci) @@ -125,50 +136,39 @@ (send renderer transfer-info ci (resolve-info-ci (xrefs-ri xrefs)))) ;; Returns (values ) -(define (xref-binding-tag xrefs id/binding mode - #:space [space #f] - #:suffix [suffix space]) - (let ([search - (lambda (id/binding) - (let ([tag (find-scheme-tag #f (xrefs-ri xrefs) id/binding mode - #:space space - #:suffix suffix)]) - (if tag - (values tag (eq? (car tag) 'form)) - (values #f #f))))]) - (cond - [(identifier? id/binding) - (search id/binding)] - [(and (list? id/binding) - (= 7 (length id/binding))) - (search id/binding)] - [(and (list? id/binding) - (= 2 (length id/binding))) - (let loop ([src (car id/binding)]) - (cond - [(module-path-index? src) - (search (list src (cadr id/binding)))] - [(module-path? src) - (loop (module-path-index-join src #f))] - [else - (raise-argument-error 'xref-binding-definition->tag - "(list/c (or/c module-path? module-path-index?) any/c)" - id/binding)]))] - [else (raise-argument-error 'xref-binding-definition->tag - (string-append - "(or/c identifier? (lambda (l)\n" - " (and (list? l)\n" - " (or (= (length l) 2)\n" - " (= (length l) 7)))))") - id/binding)]))) - -(define (xref-binding->definition-tag xrefs id/binding mode +(define (xref-binding-tag xrefs id/binding mode #:space [space #f] #:suffix [suffix space]) + (define (search id/binding) + (let ([tag (find-scheme-tag #f (xrefs-ri xrefs) id/binding mode #:space space #:suffix suffix)]) + (if tag + (values tag (eq? (car tag) 'form)) + (values #f #f)))) + (cond + [(identifier? id/binding) (search id/binding)] + [(and (list? id/binding) (= 7 (length id/binding))) (search id/binding)] + [(and (list? id/binding) (= 2 (length id/binding))) + (let loop ([src (car id/binding)]) + (cond + [(module-path-index? src) (search (list src (cadr id/binding)))] + [(module-path? src) (loop (module-path-index-join src #f))] + [else + (raise-argument-error 'xref-binding-definition->tag + "(list/c (or/c module-path? module-path-index?) any/c)" + id/binding)]))] + [else + (raise-argument-error 'xref-binding-definition->tag + (string-append "(or/c identifier? (lambda (l)\n" + " (and (list? l)\n" + " (or (= (length l) 2)\n" + " (= (length l) 7)))))") + id/binding)])) + +(define (xref-binding->definition-tag xrefs + id/binding + mode #:space [space #f] #:suffix [suffix space]) - (let-values ([(tag form?) (xref-binding-tag xrefs id/binding mode - #:space space - #:suffix suffix)]) - tag)) + (define-values (tag form?) (xref-binding-tag xrefs id/binding mode #:space space #:suffix suffix)) + tag) (define (xref-tag->path+anchor xrefs tag #:render% [render% (html:render-mixin render%)] @@ -180,15 +180,13 @@ tag->path+anchor (xrefs-ri xrefs) tag)) (define (xref-tag->index-entry xrefs tag) - (let ([v (hash-ref - (collect-info-ext-ht (resolve-info-ci (xrefs-ri xrefs))) - `(index-entry ,tag) - #f)]) - (let ([v (if (known-doc? v) - (known-doc-v v) - v)]) - (cond [v (make-entry (car v) (cadr v) (cadr tag) (caddr v))] - [(and (pair? tag) (eq? 'form (car tag))) - ;; Try again with 'def: - (xref-tag->index-entry xrefs (cons 'def (cdr tag)))] - [else #f])))) + (define v + (hash-ref (collect-info-ext-ht (resolve-info-ci (xrefs-ri xrefs))) `(index-entry ,tag) #f)) + (let ([v (if (known-doc? v) + (known-doc-v v) + v)]) + (cond + [v (make-entry (car v) (cadr v) (cadr tag) (caddr v))] + ;; Try again with 'def: + [(and (pair? tag) (eq? 'form (car tag))) (xref-tag->index-entry xrefs (cons 'def (cdr tag)))] + [else #f]))) diff --git a/scribble-test/tests/scribble/reader.rkt b/scribble-test/tests/scribble/reader.rkt index ed0627b692..935a900a70 100644 --- a/scribble-test/tests/scribble/reader.rkt +++ b/scribble-test/tests/scribble/reader.rkt @@ -949,12 +949,12 @@ END-OF-TESTS (regexp-match #px"^(.*\\S)\\s+(-\\S+->)\\s+(\\S.*)$" t))) (unless (and m (= 4 (length m))) (error 'bad-test "~a" t)) - (let-values ([(x y) ((string->tester (caddr m)) (cadr m) (cadddr m))]) - (test #:failure-message (format "bad result in\n ~a\n results:\n ~s != ~s" - (regexp-replace* #rx"\n" t "\n ") - x - y) - (matching? x y)))))) + (define-values (x y) ((string->tester (caddr m)) (cadr m) (cadddr m))) + (test #:failure-message (format "bad result in\n ~a\n results:\n ~s != ~s" + (regexp-replace* #rx"\n" t "\n ") + x + y) + (matching? x y))))) ;; Check static versus dynamic readtable for command (dynamic when "c" in the ;; name) and datum (dynamic when "d" in the name) parts: From 94fc8b6ad7bd703e16126b5b6d921b78c90f7948 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 04/11] Fix 1 occurrence of `for-each-to-for` This `for-each` operation can be replaced with a `for` loop. --- scribble-lib/scribble/srcdoc.rkt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scribble-lib/scribble/srcdoc.rkt b/scribble-lib/scribble/srcdoc.rkt index 44e848c1e8..8120aef65b 100644 --- a/scribble-lib/scribble/srcdoc.rkt +++ b/scribble-lib/scribble/srcdoc.rkt @@ -412,11 +412,13 @@ [((x y) ...) (andmap identifier? (syntax->list #'(x ... y ...)))] [((x y) ...) - (for-each - (λ (var) - (unless (identifier? var) - (raise-syntax-error #f "expected an identifier in the optional names" stx var))) - (syntax->list #'(x ... y ...)))] + (for ([var (in-list (syntax->list #'(x ... y ...)))]) + (unless (identifier? var) + (raise-syntax-error + #f + "expected an identifier in the optional names" + stx + var)))] [(a ...) (for-each (λ (a) From aa99367845bce992e0116f33e82d07ea20758f04 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 05/11] Fix 1 occurrence of `if-begin-to-cond` Using `cond` instead of `if` here makes `begin` unnecessary --- scribble-lib/scribble/tag.rkt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scribble-lib/scribble/tag.rkt b/scribble-lib/scribble/tag.rkt index fa9e861715..5370f579fc 100644 --- a/scribble-lib/scribble/tag.rkt +++ b/scribble-lib/scribble/tag.rkt @@ -51,13 +51,14 @@ (cond [(or (string? v) (bytes? v) (list? v)) (define b (hash-ref interned v #f)) - (if b - (or (weak-box-value b) - ;; just in case the value is GCed before we extract it: - (intern-taglet v)) - (begin - (hash-set! interned v (make-weak-box v)) - v))] + (cond + [b + (or (weak-box-value b) + ;; just in case the value is GCed before we extract it: + (intern-taglet v))] + [else + (hash-set! interned v (make-weak-box v)) + v])] [else v]))) (define (do-module-path-index->taglet mod) From 4d810f8c96ab022b500bb084b6673e5afab745c3 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 06/11] Fix 1 occurrence of `if-let-to-cond` `cond` with internal definitions is preferred over `if` with `let`, to reduce nesting --- scribble-lib/scribble/tag.rkt | 42 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/scribble-lib/scribble/tag.rkt b/scribble-lib/scribble/tag.rkt index 5370f579fc..abd89dda5f 100644 --- a/scribble-lib/scribble/tag.rkt +++ b/scribble-lib/scribble/tag.rkt @@ -64,26 +64,28 @@ (define (do-module-path-index->taglet mod) ;; Derive the name from the module path: (define p (collapse-module-path-index mod (lambda () (build-path (current-directory) "dummy")))) - (if (path? p) - ;; If we got a path back anyway, then it's best to use the resolved - ;; name; if the current directory has changed since we - ;; the path-index was resolved, then p might not be right. Also, - ;; the resolved path might be a symbol instead of a path. - (let ([rp (resolved-module-path-name (module-path-index-resolve mod))]) - (if (path? rp) - (intern-taglet (path->collects-relative rp)) - rp)) - (let ([p (if (and (pair? p) (eq? (car p) 'planet)) - ;; Normalize planet verion number based on current - ;; linking: - (let-values ([(path pkg) (get-planet-module-path/pkg p #f #f)]) - (list* 'planet - (cadr p) - (list (car (caddr p)) (cadr (caddr p)) (pkg-maj pkg) (pkg-min pkg)) - (cdddr p))) - ;; Otherwise the path is fully normalized: - p)]) - (intern-taglet p)))) + (cond + [(path? p) + ;; If we got a path back anyway, then it's best to use the resolved + ;; name; if the current directory has changed since we + ;; the path-index was resolved, then p might not be right. Also, + ;; the resolved path might be a symbol instead of a path. + (define rp (resolved-module-path-name (module-path-index-resolve mod))) + (if (path? rp) + (intern-taglet (path->collects-relative rp)) + rp)] + [else + (let ([p (if (and (pair? p) (eq? (car p) 'planet)) + ;; Normalize planet verion number based on current + ;; linking: + (let-values ([(path pkg) (get-planet-module-path/pkg p #f #f)]) + (list* 'planet + (cadr p) + (list (car (caddr p)) (cadr (caddr p)) (pkg-maj pkg) (pkg-min pkg)) + (cdddr p))) + ;; Otherwise the path is fully normalized: + p)]) + (intern-taglet p))])) (define collapsed (make-weak-hasheq)) (define (module-path-index->taglet mod) From 516a516089ad6f0c6b1102de04749ed8e1747039 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 07/11] Fix 1 occurrence of `for-set!-to-for/fold` `for/fold` can be used instead of a mutating `for` loop --- scribble-test/tests/scribble/reader.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scribble-test/tests/scribble/reader.rkt b/scribble-test/tests/scribble/reader.rkt index 935a900a70..ca7afa903a 100644 --- a/scribble-test/tests/scribble/reader.rkt +++ b/scribble-test/tests/scribble/reader.rkt @@ -847,9 +847,9 @@ END-OF-TESTS (values (read-all x inside-reader #t) (read-all y read))) (define (x . (mk-eval-test syntax-reader) . y) - (define r (void)) - (for ([x (read-all x (lambda (i) (syntax-reader 'test i)))]) - (set! r (call-with-values (lambda () (eval x ns)) list))) + (define r + (for/fold ([r (void)]) ([x (read-all x (lambda (i) (syntax-reader 'test i)))]) + (call-with-values (lambda () (eval x ns)) list))) (values r (read-all y read))) (define (x . (mk-syntax-test syntax-reader) . y) From a0e8b28e3f8da1cec9e9608a07c42717aad4af72 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 08/11] Fix 1 occurrence of `provide/contract-to-contract-out` The `provide/contract` form is a legacy form made obsolete by `contract-out`. --- scribble-lib/scribble/sigplan.rkt | 51 ++++++++----------------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/scribble-lib/scribble/sigplan.rkt b/scribble-lib/scribble/sigplan.rkt index d57ed2d5a6..420a2b9518 100644 --- a/scribble-lib/scribble/sigplan.rkt +++ b/scribble-lib/scribble/sigplan.rkt @@ -8,44 +8,19 @@ scribble/latex-properties (for-syntax racket/base)) -(provide/contract - [abstract - (->* () () #:rest (listof pre-content?) - block?)] - [subtitle - (->* () () #:rest (listof pre-content?) - content?)] - [authorinfo - (-> pre-content? pre-content? pre-content? - block?)] - [conferenceinfo - (-> pre-content? pre-content? - block?)] - [copyrightyear - (->* () () #:rest (listof pre-content?) - block?)] - [copyrightdata - (->* () () #:rest (listof pre-content?) - block?)] - [exclusive-license - (->* () () - block?)] - [doi - (->* () () #:rest (listof pre-content?) - block?)] - [to-appear - (->* () () #:rest pre-content? - block?)] - [category - (->* (pre-content? pre-content? pre-content?) - ((or/c #f pre-content?)) - content?)] - [terms - (->* () () #:rest (listof pre-content?) - content?)] - [keywords - (->* () () #:rest (listof pre-content?) - content?)]) +(provide (contract-out + [abstract (->* () () #:rest (listof pre-content?) block?)] + [subtitle (->* () () #:rest (listof pre-content?) content?)] + [authorinfo (-> pre-content? pre-content? pre-content? block?)] + [conferenceinfo (-> pre-content? pre-content? block?)] + [copyrightyear (->* () () #:rest (listof pre-content?) block?)] + [copyrightdata (->* () () #:rest (listof pre-content?) block?)] + [exclusive-license (->* () () block?)] + [doi (->* () () #:rest (listof pre-content?) block?)] + [to-appear (->* () () #:rest pre-content? block?)] + [category (->* (pre-content? pre-content? pre-content?) ((or/c #f pre-content?)) content?)] + [terms (->* () () #:rest (listof pre-content?) content?)] + [keywords (->* () () #:rest (listof pre-content?) content?)])) (provide preprint 10pt nocopyright onecolumn noqcourier notimes include-abstract) From 34abf3dd2335d5733ce90cb412635a11ad0ed712 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 09/11] Fix 1 occurrence of `or-hash-ref-set!-to-hash-ref!` This expression can be replaced with a simpler, equivalent `hash-ref!` expression. --- scribble-lib/scribble/xref.rkt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scribble-lib/scribble/xref.rkt b/scribble-lib/scribble/xref.rkt index 11f62f6437..52d917211b 100644 --- a/scribble-lib/scribble/xref.rkt +++ b/scribble-lib/scribble/xref.rkt @@ -85,10 +85,7 @@ [ci (send renderer collect null null fp (lambda (key ci) (define use-obj (collect-info-ext-ht ci)) - (define use-id (or (hash-ref use-ids use-obj #f) - (let ([s (gensym 'render)]) - (hash-set! use-ids use-obj s) - s))) + (define use-id (hash-ref! use-ids use-obj (λ () (gensym 'render)))) (define src (demand-source-for-use key use-id)) (and src (load-source src ci))))]) From f3e7317e4242e1c9322160b52cddb3ec795aa77e Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 10/11] Fix 1 occurrence of `if-void-to-when-or-unless` This conditional expression can be replaced with a simpler, equivalent expression. --- scribble-lib/scribble/xref.rkt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scribble-lib/scribble/xref.rkt b/scribble-lib/scribble/xref.rkt index 52d917211b..60858b4a1d 100644 --- a/scribble-lib/scribble/xref.rkt +++ b/scribble-lib/scribble/xref.rkt @@ -125,9 +125,8 @@ [_ (send renderer transfer-info ci (resolve-info-ci (xrefs-ri xrefs)))] [ri (send renderer resolve (list doc) (list dest-file) ci)] [xs (send renderer render (list doc) (list dest-file) ri)]) - (if dest-file - (void) - (car xs)))) + (unless dest-file + (car xs)))) (define (xref-transfer-info renderer ci xrefs) (send renderer transfer-info ci (resolve-info-ci (xrefs-ri xrefs)))) From 8c14cbbf69750070210cc82d9f6e672ab9998da9 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 01:30:48 +0000 Subject: [PATCH 11/11] Fix 4 occurrences of `arrow-contract-with-rest-to-arrow-contract-with-ellipses` This `->*` contract can be rewritten using `->` with ellipses. --- scribble-lib/scribble/acmart.rkt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scribble-lib/scribble/acmart.rkt b/scribble-lib/scribble/acmart.rkt index f75a79e489..5955f428b8 100644 --- a/scribble-lib/scribble/acmart.rkt +++ b/scribble-lib/scribble/acmart.rkt @@ -45,8 +45,8 @@ #:email (or/c pre-content? email? (listof email?))) #:rest (listof pre-content?) block?)] - [authorsaddresses (->* () () #:rest (listof pre-content?) block?)] - [shortauthors (->* () () #:rest (listof pre-content?) element?)] + [authorsaddresses (-> pre-content? ... block?)] + [shortauthors (-> pre-content? ... element?)] [institution (->* () (#:departments (listof (or/c pre-content? institution?))) @@ -67,7 +67,7 @@ #:country (or/c pre-content? #f)) affiliation?)] [affiliation? (-> any/c boolean?)] - [abstract (->* () () #:rest (listof pre-content?) block?)] + [abstract (-> pre-content? ... block?)] [acmConference (-> string? string? string? block?)] [grantsponsor (-> string? string? string? content?)] [grantnum (->* (string? string?) (#:url string?) content?)] @@ -76,7 +76,7 @@ [received (->* (string?) (#:stage string?) block?)] [citestyle (-> content? block?)] [ccsdesc (->* (string?) (#:number exact-integer?) block?)] - [CCSXML (->* () () #:rest (listof pre-content?) any/c)])) + [CCSXML (-> pre-content? ... any/c)])) (provide invisible-element-to-collect-for-acmart-extras include-abstract)