From 95575d09b0d7366a6d7ae42d5c9df4d3cc437e64 Mon Sep 17 00:00:00 2001 From: Robby Findler <robby@racket-lang.org> Date: Thu, 3 May 2012 11:34:37 -0500 Subject: [PATCH] fix proc-doc/names documentation closes PR 12739 original commit: f2816e72b4a106399ea075988d337c6ab0f38076 --- collects/scribblings/scribble/srcdoc.scrbl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/collects/scribblings/scribble/srcdoc.scrbl b/collects/scribblings/scribble/srcdoc.scrbl index 58bbe29b..50541e49 100644 --- a/collects/scribblings/scribble/srcdoc.scrbl +++ b/collects/scribblings/scribble/srcdoc.scrbl @@ -68,9 +68,10 @@ to get core Racket forms and basic Scribble functions to use in documentation expressions.} @defform*/subs[#:literals (-> ->* case->) - [(proc-doc/names id contract ((arg-id ...) ((arg-id default-expr) ...)) - desc-expr)] - ([contract (-> arg ... result) + [(proc-doc/names id contract arg-specs desc-expr)] + ([arg-specs ((arg-id ...) ((arg-id default-expr) ...)) + (arg-id ...)] + [contract (-> arg ... result) (->* (mandatory ...) (optional ...) result) (case-> (-> arg ... result) ...)] [mandatory contract-expr @@ -82,11 +83,14 @@ When used in @racket[provide/doc], exports @racket[id] with the contract described by @racket[contract] just like using @racket[provide/contract]. -The @racket[arg-id]s specify the names of arguments, which are not +The @racket[arg-spec] specifies the names of arguments and the +default values, which are not normally written as part of a contract. They are combined with the contract expression to generate the description of the binding in the documentation via @racket[defproc]. The @racket[(arg-id default-expr)] pairs specify the names and default values of the optional arguments. +If the contract supports optional arguments, then the first +@racket[arg-spec]s form must be used, otherwise the second must be used. The @racket[desc-expr] is a documentation-time expression that produces prose to describe the exported binding---that is, the last