From 867af4149a9816f9ad4f0ad023c0aeffceeebe5a Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 16 Sep 2011 10:27:10 -0400 Subject: [PATCH] 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 --- collects/scribble/private/manual-proc.rkt | 4 ++++ collects/scribblings/scribble/struct.scrbl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/scribble/private/manual-proc.rkt b/collects/scribble/private/manual-proc.rkt index f845bf82..c7b9eaca 100644 --- 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 index 4aa9c8d9..ff070f56 100644 --- 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?] )]{