From a2ebeaa1bba0b292584d286509caa17240c54919 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 27 Jun 2007 03:47:55 +0000 Subject: [PATCH] start porring docs on exn, threads, and custodians svn: r6746 original commit: 23158078f374a9a869d06ed4760742f06f33e9e4 --- collects/scribble/html-render.ss | 3 ++- collects/scribble/manual.ss | 24 +++++++++++++++++------- collects/scribble/scheme.ss | 2 +- collects/scribble/scribble.css | 4 ---- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index fe8f4525..fddce7da 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -130,7 +130,8 @@ `((,(case (length number) [(0) 'h2] [(1) 'h3] - [else 'h4]) + [(2) 'h4] + [else 'h5]) ,@(format-number number '((tt nbsp))) ,@(if (part-tag d) `((a ((name ,(format "~a" `(part ,(part-tag d))))))) diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index d01ed7af..521add3b 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -180,7 +180,8 @@ ;; ---------------------------------------- - (provide defproc defproc* defstruct defthing defform defform* defform/subs defform*/subs defform/none + (provide defproc defproc* defstruct defthing defparam + defform defform* defform/subs defform*/subs defform/none specform specform/subs specsubform specsubform/subs specspecsubform specspecsubform/subs specsubform/inline schemegrammar schemegrammar* @@ -240,8 +241,10 @@ (lambda () (list desc ...)))])) (define-syntax defstruct (syntax-rules () + [(_ name fields #:immutable desc ...) + (*defstruct (quote-syntax name) 'name 'fields #t (lambda () (list desc ...)))] [(_ name fields desc ...) - (*defstruct (quote-syntax name) 'name 'fields (lambda () (list desc ...)))])) + (*defstruct (quote-syntax name) 'name 'fields #f (lambda () (list desc ...)))])) (define-syntax (defform*/subs stx) (syntax-case stx () [(_ #:literals (lit ...) [spec spec1 ...] ([non-term-id non-term-form ...] ...) desc ...) @@ -342,6 +345,10 @@ (syntax-rules () [(_ id result desc ...) (*defthing (quote-syntax id) 'id 'result (lambda () (list desc ...)))])) + (define-syntax defparam + (syntax-rules () + [(_ id arg contract desc ...) + (defproc* ([(id) contract] [(id [arg contract]) void?]) desc ...)])) (define-syntax schemegrammar (syntax-rules () [(_ #:literals (lit ...) id clause ...) (*schemegrammar '(lit ...) @@ -587,7 +594,7 @@ (map symbol->string (car wrappers))))))) (cdr wrappers)))) - (define (*defstruct stx-id name fields content-thunk) + (define (*defstruct stx-id name fields immutable? content-thunk) (define spacer (hspace 1)) (make-splice (cons @@ -613,10 +620,13 @@ (map (lambda (f) (list name '- (car f))) fields) - (map (lambda (f) - (list 'set- name '- (car f) '!)) - fields))))) - ,(map car fields)))))))) + (if immutable? + null + (map (lambda (f) + (list 'set- name '- (car f) '!)) + fields)))))) + ,(map car fields) + ,@(if immutable? '(#:immutable) null)))))))) (map (lambda (v) (cond [(pair? v) diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss index c820bad7..c762f205 100644 --- a/collects/scribble/scheme.ss +++ b/collects/scribble/scheme.ss @@ -111,7 +111,7 @@ (define advance (case-lambda [(c init-line! delta) - (let ([c (+ delta (syntax-column c))] + (let ([c (+ delta (or (syntax-column c) 0))] [l (syntax-line c)]) (let ([new-line? (and l (l . > . line))]) (when new-line? diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css index 887ca883..2310f499 100644 --- a/collects/scribble/scribble.css +++ b/collects/scribble/scribble.css @@ -69,10 +69,6 @@ margin-right: 0em; } - h1,h2,h3,h4,h5,h6 { - margin-top: .5em; - } - .toclink { text-decoration: none; color: blue;