From a0fd33678fb4bb18fd9a9d7907f288ffd566ae25 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 3 Aug 2008 18:58:04 +0000 Subject: [PATCH] * Added `note-init-lib' for libraries in scheme/init * Use it in help.scrbl and in enter.scrbl (which is not reprovided by scheme) * Updated init.scrbl * Improved code in reference.scrbl svn: r11051 --- collects/scribblings/reference/enter.scrbl | 2 +- collects/scribblings/reference/help.scrbl | 9 +----- collects/scribblings/reference/init.scrbl | 5 +-- collects/scribblings/reference/mz.ss | 22 +++++++++++-- .../scribblings/reference/reference.scrbl | 32 ++++++++----------- 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/collects/scribblings/reference/enter.scrbl b/collects/scribblings/reference/enter.scrbl index 8b7b4056c2..7c5141c774 100644 --- a/collects/scribblings/reference/enter.scrbl +++ b/collects/scribblings/reference/enter.scrbl @@ -4,7 +4,7 @@ @title[#:tag "enter"]{Interactive Module Loading} -@note-lib[scheme/enter] +@note-init-lib[scheme/enter] @defform*[[(enter! module-path) (enter! #f)]]{ diff --git a/collects/scribblings/reference/help.scrbl b/collects/scribblings/reference/help.scrbl index d9cc751094..518a5f92bc 100644 --- a/collects/scribblings/reference/help.scrbl +++ b/collects/scribblings/reference/help.scrbl @@ -6,14 +6,7 @@ @title{Interactive Help} -@declare-exporting[scheme/help scheme/init] - -@defmodule*/no-declare[(scheme/help)]{The @scheme[help] form documented -in this section is provided by the @schememodname[scheme/help] and -@schememodname[scheme/init] libraries, which means that it is -available when @exec{mzscheme} is started with no command-line -arguments. It is not provided by @scheme[scheme] or -@scheme[scheme/base].} +@note-init-lib[scheme/help] @deftogether[( @defidform[help] diff --git a/collects/scribblings/reference/init.scrbl b/collects/scribblings/reference/init.scrbl index 6d1e68861d..973edaed63 100644 --- a/collects/scribblings/reference/init.scrbl +++ b/collects/scribblings/reference/init.scrbl @@ -7,8 +7,9 @@ @defmodule*/no-declare[(scheme/init)]{The @schememodname[scheme/init] library is the default start-up library for MzScheme. It re-exports -the @schememodname[scheme] and @schememodname[scheme/help] libraries, -and it sets @scheme[current-print] to use @scheme[pretty-print].} +the @schememodname[scheme], @schememodname[scheme/enter] and +@schememodname[scheme/help] libraries, and it sets +@scheme[current-print] to use @scheme[pretty-print].} @defmodule*/no-declare[(scheme/gui/init)]{The @schememodname[scheme/gui/init] library is the default start-up diff --git a/collects/scribblings/reference/mz.ss b/collects/scribblings/reference/mz.ss index eacf3ff40e..deea372595 100644 --- a/collects/scribblings/reference/mz.ss +++ b/collects/scribblings/reference/mz.ss @@ -32,11 +32,29 @@ " and " (schememodname scheme) " libraries, but not " (schememodname scheme/base) - "." + "." . more)))] [(_ lib . more) (note-lib lib #:use-sources () . more)])) - + + (provide note-init-lib) + (define-syntax note-init-lib + (syntax-rules () + [(_ lib #:use-sources (src ...) . more) + (begin + (declare-exporting lib scheme/init #:use-sources (src ...)) + (defmodule*/no-declare (lib) + (t "The bindings documented in this section are provided by the " + (schememodname lib) + " and " + (schememodname scheme/init) + " libraries, which means that they ara available when " + (exec "mzscheme") " is started with no command-line arguments." + " They are not provided by " (schememodname scheme/base) + " or " (schememodname scheme) "." + . more)))] + [(_ lib . more) + (note-init-lib lib #:use-sources () . more)])) (provide note-lib-only) (define-syntax note-lib-only diff --git a/collects/scribblings/reference/reference.scrbl b/collects/scribblings/reference/reference.scrbl index 1a13f5ab01..a213e36d5c 100644 --- a/collects/scribblings/reference/reference.scrbl +++ b/collects/scribblings/reference/reference.scrbl @@ -1,25 +1,19 @@ #lang scribble/doc -@(require "mz.ss" - scribble/struct) +@(require "mz.ss" scribble/struct scheme/list) @(define (scheme-extra-libs) - (make-delayed-element - (lambda (renderer p ri) - (let ([keys (resolve-get-keys p ri (lambda (v) - (eq? (car v) 'scheme-extra-lib)))]) - (let ([keys (sort keys stringstring (cadr k))) - #:cache-keys? #t)]) - (let loop ([keys keys]) - (cond - [(null? keys) '("")] - [(null? (cdr keys)) (list ", and " - (resolve-get p ri (car keys)))] - [else (list* ", " (resolve-get p ri (car keys)) - (loop (cdr keys)))]))))) - (lambda () "...") - (lambda () "..."))) + (make-delayed-element + (lambda (renderer p ri) + (let ([mods (append-map + (lambda (k) (list ", " (resolve-get p ri k))) + (sort (resolve-get-keys + p ri (lambda (v) (eq? (car v) 'scheme-extra-lib))) + stringstring (cadr k))) + #:cache-keys? #t))]) + `(,@(drop-right mods 2) ", and " ,(last mods)))) + (lambda () "...") + (lambda () "..."))) @title{@bold{Reference}: PLT Scheme}