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
This commit is contained in:
Eli Barzilay 2011-09-16 10:27:10 -04:00
parent 240449694b
commit 867af4149a
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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?]
)]{