diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index 2111e096..f66c6be1 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -93,11 +93,13 @@ [(_ x) (add-scheme-index 'x (scheme x))])) (define (add-scheme-index s e) - (let ([k (if (and (pair? s) - (eq? (car s) 'quote)) - (cadr s) - s)]) - (index* (list (format "~s" k)) (list e) e))) + (let ([k (cond + [(and (pair? s) + (eq? (car s) 'quote)) + (format "~s" (cadr s))] + [(string? s) s] + [else (format "~s" s)])]) + (index* (list k) (list e) e))) (provide schemeblock SCHEMEBLOCK schemeblock0 SCHEMEBLOCK0 @@ -177,6 +179,20 @@ ;; ---------------------------------------- + (provide method xmethod) + + (define-syntax method + (syntax-rules () + [(_ a b) + (scheme b)])) + + (define-syntax xmethod + (syntax-rules () + [(_ a b) + (elem (scheme b) " in " (scheme a))])) + + ;; ---------------------------------------- + (provide margin-note) (define (margin-note . c) diff --git a/collects/scribblings/scribble/manual.scrbl b/collects/scribblings/scribble/manual.scrbl index 6e025a14..395a7eb6 100644 --- a/collects/scribblings/scribble/manual.scrbl +++ b/collects/scribblings/scribble/manual.scrbl @@ -109,13 +109,6 @@ module whose language is @scheme[lang].} a single line and wrapped with its enclosing paragraph, independent of the formatting of @scheme[datum].} -@defform[(indexed-scheme datum ...)]{ - -A combination of @scheme[scheme] and @scheme[as-index], with the -special case that if a single @scheme[datum] is provided and it is a -@scheme[quote] form, then the quote is removed from the key (so that -it's sorted using its unquoted form).} - @defform[(schemeresult datum ...)]{Like @scheme[scheme], but typeset as a REPL value (i.e., a single color with no hyperlinks).} @@ -504,6 +497,22 @@ the link.} @; ------------------------------------------------------------------------ @section{Indexing} +@defform[(indexed-scheme datum ...)]{ + +A combination of @scheme[scheme] and @scheme[as-index], with the +following special cases when a single @scheme[datum] is provided: + + @itemize{ + + @item{If @scheme[datum] is a @scheme[quote] form, then the quote is + removed from the key (so that it's sorted using its unquoted + form).} + + @item{If @scheme[datum] is a string, then quotes are removed from the + key (so that it's sorted using the string content).} + +}} + @defproc[(idefterm [pre-content any/c] ...) element?]{Combines @scheme[as-index] and @scheme[defterm]. The content normally should be plural, rather than singular. Consider using @scheme[deftech],