commit 867af4149a9816f9ad4f0ad023c0aeffceeebe5a
parent 240449694b1114dcd1c395ff83842bb290b9fb7c
Author: Eli Barzilay <eli@barzilay.org>
Date: Fri, 16 Sep 2011 10:27:10 -0400
Make `defproc' throw an error if two arguments have the same name.
Related to the already fixed PR 12114 and PR 12133, which motivated the
error, and a few additional typos of the same kind.
(Note that it uses the symbols, but that's how they'll render anyway.)
original commit: 16cd1ad78d6495816a4869621154024652fd8da0
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/collects/scribble/private/manual-proc.rkt b/collects/scribble/private/manual-proc.rkt
@@ -238,6 +238,10 @@
(if (symbol? (car p)) (car p) (loop (car p)))))
(define (do-one stx-id prototype args arg-contracts arg-vals result-contract
first?)
+ (let ([names (remq* '(... ...+) (map arg-id args))])
+ (unless (= (length names) (length (remove-duplicates names eq?)))
+ (error 'defproc "duplicate argument names in prototype for ~s: ~s"
+ (syntax->datum stx-id) names)))
(define tagged
(cond
[(eq? mode 'new)
diff --git a/collects/scribblings/scribble/struct.scrbl b/collects/scribblings/scribble/struct.scrbl
@@ -207,7 +207,7 @@ formats to the current one.}
[alt-path path-string?] [alt-anchor string?]) redirect-target-element?]
@defproc[(make-link-element [style any/c] [content list?] [tag tag?]) link-element?]
@defproc[(make-index-element [style any/c] [content list?] [tag tag?]
- [tag tag?] [plain-seq (and/c pair? (listof string?))]
+ [plain-seq (and/c pair? (listof string?))]
[entry-seq list?] [desc any/c]) index-element?]
)]{