improve defproc* to support multiple bindings documented together (instead of just multiple forms of the same binding)

svn: r7285

original commit: 5154426cf61509fa76f6c9a88184dab5f860cf36
This commit is contained in:
Matthew Flatt 2007-09-06 13:48:44 +00:00
parent 742e7820fa
commit 1dc75cffe9
2 changed files with 15 additions and 2 deletions

View File

@ -858,7 +858,14 @@
prototypes
arg-contractss
result-contracts
(cons #t (map (lambda (x) #f) (cdr prototypes))))))
(let loop ([ps prototypes][accum null])
(cond
[(null? ps) null]
[(ormap (lambda (a) (eq? (caar ps) a)) accum)
(cons #f (loop (cdr ps) accum))]
[else
(cons #t (loop (cdr ps)
(cons (caar ps) accum)))])))))
(content-thunk))))))
(define (make-target-element* inner-make-target-element stx-id content wrappers)

View File

@ -225,7 +225,13 @@ source layout.}
pre-flow ...)]{
Like @scheme[defproc], but for multiple cases with the same
@scheme[id]. }
@scheme[id].
When an @scheme[id] has multiple calling cases, they must be defined
with a single @scheme[defproc*], so that a single definition point
exists for the @scheme[id]. However, multiple distinct @scheme[id]s
can also be defined by a single @scheme[defproc*], for the case that
it's best to document a related group of procedures at once.}
@defform/subs[(defform maybe-literals (id . datum) pre-flow ...)